modify the lucsorter class (specifically the evenodd method) to reorder an array to have all the even elements followed by the odd elements. this will be similar to the selection sort algorithm (in this case, every odd element k found from left to right should be swapped with the first even number at the right of k). the even elements should be in the same order as they are in the input array, while the odd numbers are not required to be in the same order as in the input.

Answers

Answer 1

Pointers can be very useful when working with arrays.

What is Pointer Notation and Arrays?It's a frequent misperception that a pointer and an array can be used interchangeably. A pointer is not the name of an array. Although an array name can occasionally be treated as a pointer and pointers can be used with array notation, they are two separate concepts that are not always interchangeable. Knowing the distinction will help you avoid using these notations improperly. As an illustration, even if using an array's name alone would produce the array's location, we cannot use the name alone as the target of an assignment. A basic data structure that is included in C is an array. To create successful applications, it is essential to have a basic understanding of arrays and how they are used.

This is demonstrated in the following code sequence where each row’s address and size is displayed:

       for (int i = 0; i < 2; i++) {

        printf("&matrix[%d]: %p  sizeof(matrix[%d]): %d\n",

        i, &matrix[i], i, sizeof(matrix[i]));

   }

Program source code found in explaination

Recursive int function of the asked question.;

int productOfOdds(int array[],int length) {

int product=1;

if(length==0)

return -1;

else if(length==1) {

if(array[length-1]%2!=0)

return array[length-1];

else

return 1;

}

def sortArrayByParity(A):

array_length=len(A)

s=0

for i in range(0,array_length): #loop to iterate over the array

if A[i]%2 ==0:  #if the number is even swap it with number at position s..        t=A[s]

A[s]=A[i]

A[i]=t

s=s+1 #increasing the count...

return A

A=list(map(int,input("Enter array elements : \n").strip().split()))#taking input of the array.

print(sortArrayByParity(A))#printing the array.

My approach to do this question is to iterate over the array and take a pointer which points to the first index that is 0.If we encounter an even number swap it with first position element and increase the pointer and at last return the array.

else {

product=productOfOdds(array,--length);

if(array[length]%2!=0) {

product=product*array[length];

}

}

return product;

}

To learn more about Array refer to:

https://brainly.com/question/13326954

#SPJ4


Related Questions

What are some of the ethical issues that can arise from the use of social media?

Answers

Participant privacy, confidentiality and anonymity. Participant privacy, confidentiality and anonymity were the most commonly reported ethical concerns

when an organization seeks transference of information security risk, it is likely to make which purchase? server hard drives penetration testing services company vehicles with anti-lock brakes cyberliability insurance

Answers

When an organization seeks transference of information security risk, it is likely to purchase (F) cyber liability insurance.

Cyber liability insurance helps organizations protect against financial losses from cybersecurity incidents such as data breaches, network damage, and cyber extortion. The insurance policy covers the cost of legal fees, customer notification, credit monitoring, data recovery, and any other costs associated with the breach. By purchasing cyber liability insurance, the organization transfers the financial risk of a cybersecurity incident to the insurance company, reducing its own financial liability.

You can learn more about Cyber liability insurance at

https://brainly.com/question/28524123

#SPJ11

How
would I change the user owner and group owner on the shadow file in
linux?

Answers

In order to change the user owner and group owner on the shadow file in Linux, you can use the `chown` command.

Here's how you can do it:

Open the terminal and type the following command: `sudo chown username:groupname /etc/shadow`.

Replace `username` with the desired user's username and `groupname` with the desired group's name.

For example, if you want to change the owner to user "john" and group "admin", the command would be `sudo chown john:admin /etc/shadow`.

Note: Be very careful when making changes to system files, as incorrect changes can cause serious issues. Always backup important files before making any changes.

Learn more about command at

https://brainly.com/question/32148148

#SPJ11


Which specialized information system is used by passport agencies and border inspection agencies to check the names
of visa and passport applicants?

Emergency Department Information Systems

Superfund Information Systems

Consular Lookout and Support Systems

Geographic Information Systems

Answers

Answer:

Consular Lookup and Support System

for a 16-bit register, you should use the xor operation and a 0001001000010000 mask to toggle bits 12, 9, and 4.

Answers

Get the binary value of the 16-bit register. Create a binary mask for 0001001000010000.Step 3: XOR the register value and the mask.

By doing this, only the bits with the value 1 in the mask will change the value. Step 4: Store the new value back in the register. Here is an example of the process with a sample register value: Register value: 1111000011110000Binary mask: 0001001000010000 XOR operation: 1110001011100000 (bits 12, 9, and 4 are toggled to 0)New value stored in the register: 1110001011100000 In binary representation, a 16-bit register has bit positions from 0 to 15, where the rightmost bit is considered bit 0, and the leftmost bit is considered bit 15. To toggle bits 12, 9, and 4, you would typically use a mask that has 1s in the corresponding bit positions and 0s elsewhere.

Here's an example of how you can toggle the bits 12, 9, and 4 in a 16-bit register using the XOR operation and an appropriate mask:

python

Copy code

register = 0b0000000000000000  # Initial value of the register

mask = 0b0001001000010000     # Mask with 1s in bits 12, 9, and 4

register ^= mask             # Toggle the corresponding bits using XOR

print(bin(register))         # Print the binary representation of the updated register

The result would be the updated value of the register with the specified bits toggled according to the provided mask. Make sure to adjust the mask value to match the correct bit positions you want to toggle.

Read more about representation here;https://brainly.com/question/557772

#SPJ11

read in an input value for variable numin. then, read numin floating-point values from input and output the lowest of the floating-point values read to one decimal place. end with a newline. note: all floating-point values are of type double. ex: if the input is 3 68.0 21.8 -64.9, then the output is: -64.9

Answers

Here's a Python code snippet that reads an input value for the variable `numin` and then reads `numin` floating-point values from the input. It outputs the lowest of the floating-point values read, formatted to one decimal place.

```python

numin = int(input("Enter the number of values: "))  # Read the input value for numin

min_value = float('inf')  # Initialize min_value with positive infinity

for _ in range(numin):

   value = float(input("Enter a floating-point value: "))  # Read a floating-point value

   if value < min_value:

       min_value = value

print(f"The lowest value is: {min_value:.1f}")  # Output the lowest value to one decimal place

```

In this code, `numin` is the number of floating-point values to be read. The code then enters a loop where it reads `numin` floating-point values one by one. It keeps track of the minimum value encountered so far and updates it whenever a new lower value is read.

Finally, the code outputs the lowest value using f-string formatting with `:.1f` to format it to one decimal place.

Learn more about Python here:

https://brainly.com/question/30391554

#SPJ11

How do you get information from a form that is submitted using the "get" method in PHP?
A. $_POST[];
B. $_GET[];
C. Request.Form;
D. Request.QueryString;

Answers

In PHP, to get information from a form that is submitted using the "get" method, you would use the superglobal variable $_GET[]. The correct option is B.

The form data is added to the URL as query parameters when a form is submitted using the "get" method.

These query parameters are automatically added to the $_GET[] superglobal array by PHP. By designating the input name as the array's key in the $_GET[] structure, you can obtain the values of form inputs.

The value given by the user can be retrieved using $_GET['username'] if your form, for instance, has an input field named "username" and is submitted using the "get" method.

Thus, the correct option is B.

For more details regarding PHP, visit:

https://brainly.com/question/25666510

#SPJ4

Which of the following characterize the typical feature of c language


Answers

The typical features of C language include procedural programming, low-level memory access, extensive use of libraries, powerful control structures, and high portability. These features make C an efficient and flexible programming language, well-suited for a wide range of applications.

The typical features of the C language can be characterized by its simplicity, efficiency, and flexibility. C is a procedural programming language, which means it emphasizes the use of functions and procedures to organize code. This allows for modular programming, making it easy to break down complex problems into smaller, manageable pieces.

One of the defining characteristics of C is its low-level access to computer memory through pointers. Pointers enable efficient memory management and make it possible to work with dynamic data structures like linked lists, trees, and graphs.

Another key feature of C is its extensive use of libraries. The C standard library provides a rich set of functions for tasks such as input/output, string manipulation, and mathematical calculations. Programmers can also create their own libraries or utilize third-party libraries, further extending the functionality of the language.

C language also offers powerful control structures, such as if-else, loops, and switch-case statements. These structures provide flexibility in controlling the flow of program execution and handling various scenarios efficiently.

Moreover, C is highly portable. Code written in C can be easily compiled and executed on different computer architectures with minimal changes. This portability has made C the language of choice for developing system software, like operating systems and compilers, as well as application software across platforms.

In summary, the typical features of C language include procedural programming, low-level memory access, extensive use of libraries, powerful control structures, and high portability. These features make C an efficient and flexible programming language, well-suited for a wide range of applications.

Learn more about C language here:

https://brainly.com/question/30101710

#SPJ11

The data you enter into a statistical software program to perform analyses on constitutes values of the ______________.
a. dependent variable
b. independent variable
c. extraneous variable
d. confound

Answers

The data is entered into a statistical software program to perform analyses on constitutes values of the dependent variable. The dependent variable is the outcome variable that is measured or observed during an experiment. So, the correct option is A.

It is the variable that is affected by the independent variable, which is the variable being manipulated or changed by the researcher. The independent variable is used to see how it affects the dependent variable. For example, if a researcher wanted to study the effects of caffeine on cognitive performance, they would manipulate the independent variable (caffeine consumption) and measure the dependent variable (cognitive performance).

Extraneous variables are variables that can potentially affect the outcome of an experiment but are not intentionally manipulated by the researcher. These variables are often controlled for in the study design or through statistical methods to ensure they do not confound the results.

Confounding variables are variables that have an impact on the dependent variable that cannot be distinguished from the effects of the independent variable. Confounding variables can lead to inaccurate or misleading results, so it is important for researchers to identify and control for them during the study design and analysis process.

Overall, understanding the role of dependent and independent variables is essential for conducting effective and accurate statistical analyses.

You can learn more about statistical software programs at: brainly.com/question/17017761

#SPJ11

There is a weird green and black kinda growth on my screen that moves when I squeeze the screen, it also looks kinda like a glitchy thing too,Please help

Answers

LCD stands for Liquid Crystal Display. So yes, what you're seeing is liquid. it's no longer contained where it needs to be.

Instances where a change in in one bit in the plaintext would affect all the bits of the ciphertext is best described by what term?

Answers

In summary, the avalanche effect describes situations where a change in one bit in the plaintext affects all the bits of the ciphertext, enhancing the security of encryption algorithms.

The avalanche effect refers to the property of a cryptographic algorithm where a small change in the input, such as a single bit flip in the plaintext, causes a significant change in the output, the ciphertext. The avalanche effect is  enhances the security by making it difficult to predict the relationship between the plaintext and the ciphertext.

It ensures that even a small change in the original message will result in a completely different encrypted message consider a simple encryption algorithm that uses XOR operation to encrypt a message. The change in one bit in the plaintext has caused a complete change in the bits of the ciphertext, demonstrating the avalanche effect.

To know more about situations visit:

https://brainly.com/question/30582564

#SPJ11

What are the method of making glass

Answers

Answer:

The process involves wetting the edge of a blowpipe (blowtube) and dipping it into a furnace that has molten liquid glass.

Explanation:

The desired amount (glob) then sticks on to the pipe (spooling) and the 'glassmith', 'glassblower', or 'gaffer' blows air through the other end of the pipe to make the desired shape.

Answer:

Core-forming. the earliest method of making glass vessels is known as core-forming.

Casting. This process involved the shaping of molten glass in a closed mould or over an open former. ...

Blowing. ...

Mould-blowing. ...

Pattern-moulding. ...

Tralling. ...

Cutting. ...

Fire-polishing.

Explanation:

help pleaseee got 15 points on this

.

Roxy has some raw footage shot on a videotape. She wants to edit this footage. She decides to use the linear editing technique. How should she set up her equipment? Roxy should load the raw footage in the ______ and a blank tape in the ______ first blank: VTR deck, VTP deck, edit controller. second blank is the same thing​

Answers

I belive it is vtr deck

in this lab, you will complete a prewritten java program that computes the largest and smallest of three integer values. the three values are –50, 53, and 78.

Answers

The pre-written Java program computes the largest and smallest of three integer values (-50, 53, and 78) using conditional statements. The largest number is printed first, followed by the smallest number.

In this lab, you will complete a pre-written java program that computes the largest and smallest of three integer values.

The three values are -50, 53, and 78.In order to compute the largest and smallest of the three integer values (-50, 53, and 78), we can write a Java program that makes use of conditional statements to evaluate which number is greater or smaller.

Here is the program code to compute the largest and smallest of three integer values.

```public class LargestSmallest{public static void main(String[] args) {int a=-50, b=53, c=78;int largest, smallest;if(a>b && a>c){largest=a;}else if(b>a && b>c){largest=b;}else{largest=c;}System.out.println("Largest number is "+largest);if(a

Learn more about Java program: brainly.com/question/26789430

#SPJ11

24 3 Ans a. Define the term computer hardware. b. C. What are input devices? List any two input devices. What is processing device? Write the name of processing devices d. What are output devices? Name any two common output devices Differentiate between soft copy output and hard copy output? f. What are storage devices? Write two such devices. e. g. What is primary memory? What are its types. h. What are the differences between RAM and ROM? i. What is CPU? List its major parts. j. Write short notes on the following: i. Keyboard Rising School Level Computer Science - 6 ii. Control unit iii. Printer​

Answers

Explanation:

hardware are the physical parts of the computer which can be touched seen and felt is called hardware.

the device which are use to inter data and instructions from the user is clawed input device. foreg; keyboard , mouse.

the processing device of computer is cpu

the printed information which can be touched and seen is Called hardcopy .

soft copy are which can be seen but not touched is called soft copy .

the device that are use to store data and instructions is called storage devices.

Which of the following groups is NOT located on the Home tab?

A.Paragraph
B.Animations
C.Slides
D.Drawing

Answers

Answer: B. Animations is not found on the Home tab.

The answer is B. The Animations group is not located on the home tab.

(C++) Write code to complete RaiseToPower(). Sample output if userBase is 4 and userExponent is 2 is shown below. Note: This example is for practicing recursion; a non-recursive function, or using the built-in function pow(), would be more common.4^2 = 16Given: #nclude using namespace std;int RaiseToPower(int baseVal, int exponentVal){int resultVal = 0;if (exponentVal == 0) {resultVal = 1;}else {resultVal = baseVal * //your solution goes here;}return resultVal;}int main() {int userBase = 0;int userExponent = 0;userBase = 4;userExponent = 2;cout << userBase << "^" << userExponent << " = "<< RaiseToPower(userBase, userExponent) << endl;return 0;}

Answers

Answer:

Following are the code to this question:

RaiseToPower(baseVal, exponentVal-1);//calling method RaiseToPower and in second parameter we subtract value  

resultVal = baseVal * RaiseToPower(baseVal, exponentVal-1);//defining resultVal variable that calculate baseVal and method value

Explanation:

In the above-given code inside the "RaiseToPower" method is defined that accepts two parameters, which are "baseVal and exponentVal" and inside the method, an integer variable "resultVal"  is defined, that holds a value that is 0.

In the next step, if the conditional statement is used, in if the block it checks the "exponentVal" variable value that is equal to 0, if it is true it assigns value 1 in "resultVal" otherwise it will go to else block in this block, the "resultVal" variable holds "baseVal" variable value and call the "RaiseToPower" method, and multiply the baseVal and method and store its value in resultVal and return the value. Inside the main method, two integer variable userBase, userExponent is defined that holds a value and calls the above method and prints its return value.

please find the attachment of the code file and its output.

(C++) Write code to complete RaiseToPower(). Sample output if userBase is 4 and userExponent is 2 is

is a low-cost, centrally managed computer with limited capabilities and no internal or external attached drives for data storage. a. thin client b. nettop computer c. workstation d. cloud computer

Answers

The given question can be answered by option 'a. Thin client.' A low-cost, centrally managed computer with limited capabilities and no internal or external attached drives for data storage is called a thin client.

What is a thin client?

A thin client, sometimes known as a slim client, is a low-cost, centrally managed computer with limited capabilities and no internal or external attached drives for data storage. Thin clients are used in a client-server architecture to allow for remote access to graphically intensive applications. In other words, thin clients are computers that use a server's processing power to drive the user interface and other computer functions.

What are the benefits of using thin client computers?

Thin clients provide a number of advantages, including the following:Lower costs: Thin clients are less expensive than standard PCs. Because they don't require a lot of processing power, they don't require high-end components. They also don't have internal storage, which can be a significant expense.Reduced Maintenance: Thin clients are much simpler to maintain than standard PCs. They are centrally managed, which means that administrators may deploy updates and software patches to all devices at the same time. Thin clients, unlike standard computers, do not require frequent updates or antivirus software. Because there is no internal hard drive, there is little risk of data loss in the event of a hard drive failure.

Learn more about computer  here: https://brainly.com/question/26409104

#SPJ11

Data sets can be described as instances when the software didn't work as expected.

True
False

Answers

The statement, "Datasets can be described as instances when the software didn't work as expected" is False.

What is a dataset?

A dataset can be viewed as a network of data. Often, the data are interrelated and can be used to arrive at objective opinions. For data analysts who often have to work with complex data, datasets are a common feature in their jobs.

The datasets can be stored in databases and they draw the information they need from these datasets with the aid of queries from programming languages like the structured Query language.

Learn more about datasets here:

https://brainly.com/question/29342132

#SPJ1

Q2-2) Answer the following two questions for the code given below: public class Square { public static void Main() { int num; string inputString: Console.WriteLine("Enter an integer"); inputString = C

Answers

The code given below is a basic C# program. This program takes an input integer from the user and computes its square. The program then outputs the result. There are two questions we need to answer about this program.

Question 1: What is the purpose of the program?The purpose of the program is to take an input integer from the user, compute its square, and output the result.

Question 2: What is the output of the program for the input 5?To find the output of the program for the input 5, we need to run the program and enter the input value. When we do this, the program computes the square of the input value and outputs the result. Here is what the output looks like:Enter an integer5The square of 5 is 25Therefore, the output of the program for the input 5 is "The square of 5 is 25".The code is given below:public class Square {public static void Main() {int num;string inputString;Console.WriteLine("Enter an integer");inputString = Console.ReadLine();num = Int32.Parse(inputString);Console.WriteLine("The square of " + num + " is " + (num * num));}}

To know more about output  visit:

https://brainly.com/question/14227929

#SPJ11


Isabela wants to add an image to her presentation. Which tab should she use?

Answers

The “add image” tab ??

Answer:Insert

Explanation:

Edg. 2021

A single computer on a network is called a____________.

Answers

Is it a vpn, I’m just guessing bc I don’t know anything about this stuff lol

Answer: A single computer on a network is called a node. pls brainliest

pls help ASAP!! will give brainliest

pls help ASAP!! will give brainliest

Answers

Answer:

a is the CPU

b is the ram

c is the mother board

d is the power supply

e is the hard drive

Explanation:

a is the brain of the computer it directs things

b is the temporary storage  

c the mother board processes things

d this gives the computer power

e is the long storage

What are the basic linux file permissions? Check all that apply.
Read
Write
Modify
Execute

Answers

The three basic file permissions in Linux are read, write, and execute.

A family of open-source Unix-like operating systems known as Linux are based on the Linux kernel, which Linus Torvalds initially made available on September 17, 1991. The kernel and other system-supporting programs and libraries, many of which are made available by the GNU Project, are often included in Linux distributions, which are how Linux is typically packaged. Many Linux versions have the word "Linux" in their name, while the Free Software Foundation prefers to refer to their operating system as "GNU/Linux" to stress the significance of GNU software, which has generated some debate.

Debian, Fedora Linux, and Ubuntu are popular Linux distributions. Ubuntu itself is made up of numerous other distributions and customizations, such as Lubuntu and Xubuntu. Red Hat Enterprise Linux and SUSE Linux Enterprise are examples of commercial distributions.

Learn more about Linux:

https://brainly.com/question/14377687

#SPJ4

q3.1: for 8-bit data values, what is the fraction of code words that are valid? how many possible data can you write using 8 bits? now, apply the coding scheme, how many possible combinations do you have? what fraction of that are valid code words following the described coding scheme?

Answers

For 8-bit data values, there are 256 possible combinations. However, when applying a specific coding scheme, the fraction of valid code words may be less than 1.

With 8 bits, there are 256 possible combinations since each bit can be either 0 or 1, resulting in 2 possibilities per bit. However, when applying a specific coding scheme, the fraction of valid code words may be less than 1. The number of possible combinations depends on the coding scheme used. For example, if a particular coding scheme allows for error detection or correction, it may introduce redundancy and limit the number of valid code words. In such cases, not all 256 possible combinations may be valid code words. The fraction of valid code words can be calculated by dividing the number of valid code words by the total number of possible combinations, resulting in a fraction that represents the portion of valid code words within the coding scheme.

Learn more about coding  here;

https://brainly.com/question/17204194

#SPJ11

Where does the kinetic energy of a rotating coil motor come from?

Answers

Answer:

Hydraulic Motors and Rotary actuators

Explanation:

Hydraulic motors are powered by pressurized hydraulic fluid and transfer rotational kinetic energy to mechanical devices. Hydraulic motors, when powered by a mechanical source, can rotate in the reverse direction, and act as a pump.

Hydraulic rotary actuators use pressurized fluid to rotate mechanical components. The flow of fluid produces the rotation of moving components via a rack and pinion, cams, direct fluid pressure on rotary vanes, or other mechanical linkage. Hydraulic rotary actuators and pneumatic rotary actuators may have fixed or adjustable angular strokes, and can include such features as mechanical cushioning, closed-loop hydraulic dampening (oil), and magnetic features for reading by a switch.

Motor type is the most important consideration when looking for hydraulic motors. The choices include axial piston, radial piston, internal gear, external gear, and vane. An axial piston motor uses an axially mounted piston to generate mechanical energy. High-pressure flow into the motor forces the piston to move in the chamber, generating output torque. A radial-piston hydraulic motor uses pistons mounted radially about a central axis to generate energy. An alternate-form radial-piston motor uses multiple interconnected pistons, usually in a star pattern, to generate energy. Oil supply enters the piston chambers, moving each individual piston and generating torque. Multiple pistons increase the displacement per revolution through the motor, increasing the output torque. An internal gear motor uses internal gears to produce mechanical energy. Pressurized fluid turns the internal gears, producing output torque. An external gear motor uses externally mounted gears to produce mechanical energy. Pressurized fluid forces the external gears to turn, producing output torque. A vane motor uses a vane to generate mechanical energy. Pressurized fluid strikes the blades in the vane, causing it to rotate and produce output torque.

Additional operating specifications to consider include operating torque, pressure, speed, temperature, power, maximum fluid flow, maximum fluid viscosity, displacement per revolution, and motor weight. The operating torque is the torque that the motor is capable of delivering, which depends directly on the pressure of the working fluid delivered to the motor. The operating pressure is the pressure of the working fluid delivered to the hydraulic motor. The fluid is pressurized by an outside source before it is delivered to the motor. Working pressure affects operating torque, speed, flow, and horsepower of the motor. The operating speed is the speed at which the hydraulic motors’ moving parts rotate. Operating speed is expressed in terms of revolutions per minute or similar. The operating temperature is the fluid temperature range that the motor can accommodate. Minimum and maximum operating temperatures are dependent on the internal component materials of the motor, and can vary greatly between products. The power the motor is capable of delivering is dependent on the pressure and flow of the fluid through the motor. The maximum volumetric flow through the motor is expressed in terms of gallons per minute, or similar units. The maximum fluid viscosity the motor can accommodate is a measure of the fluid’s resistance to shear, and is measured in centipoise (cP), a common metric unit of dynamic viscosity equal to 0.01 poise or 1 mP. The dynamic viscosity of water at 20°C is about 1 cP (the correct unit is cP, but cPs and cPo are sometimes used). The fluid volume displaced per revolution of the motor is measured in cubic centimetres (cc) per revolution, or similar units. The weight of the motor is measured in pounds or similar units.

The CTRL, ALT, and WINDOWS keys are commonly used for keyboard shortcuts, which are keystrokes that can quickly perform an operation within software. True False

Answers

answer
True
explain



The shortcut keyboard is one or more keys that are used to performing a program and other capabilities, that's why the given statement is "True", and the further discussion can be defined as follows:

The keyboard shortcut is a set of one or more keys that invoke the preprogrammed activity of the software package.Shortcut keys are the strategic utilization key combinations on one's keyboard for more good functioning in your software. The shortcuts are in one's file folders, word processing programs, and even for e-mail accounts or social bookmarking sites.The keyboard shortcuts, CTRL, ALT, and WINDOWS, which can perform quickly in the software, are commonly used.

Therefore, the final answer is "True".

Learn more:

brainly.com/question/1212286

The CTRL, ALT, and WINDOWS keys are commonly used for keyboard shortcuts, which are keystrokes that can

5.14 lab: convert to reverse binary write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in reverse binary. for an integer x, the algorithm is: as long as x is greater than 0 output x modulo 2 (remainder is either 0 or 1) assign x with x divided by 2

Answers

A program that prints output of an algorithm in reverse is given below, complete with the algorithm:

The Algorithm

step1 = input("what number? ")#gets your input

step2 = int(step1) #makes sure it's an int not float

step3 = bin(step2) #converts it to binary (you method doesn't work for e.g. 7)

step4 = step3.replace("0b", "") #removes 0b from the binairy number

step5 = step4[::-1] #reverses the string

print (step5)

The Program

num = int(input())

while num > 0:

   y = ( num % 2 )

   print( y , end = ' ' )

   num = ( num / / 2 )

print ( )

num = int ( input ( " Enter a number " ) )

string = " "

while num > 0 :

   y = str ( num % 2 )

   string + = y

   num = ( num / / 2 )

reverse = string [ : : - 1 ]

print ( reverse )

Read more about programming here:

https://brainly.com/question/23275071

#SPJ1

Why do companies collect information about consumers? A. Because they want to meet new friends on social networks B. Because they take consumers' best interests to heart C. Because they want to effectively advertise to consumers D. Because they are looking for good employees to hire​

Answers

Answer:

C. Because they want to effectively advertise to consumers.

Explanation:

Companies collect info for more accurate advertisements, which are designed to make people interact with them more commonly.

Which of these is the best option for a file name to be linked to on the web?
A At the Concert.pdf
B REMIND theConcert.pdf
C At-the-Concert.pdf
D At+the+Concert.pdf

Answers

The best option for a file name to be linked to on the web is C At-the-Concert.pdf

What is the definition of HTML?

A web page's structure and content are organized using HTML (HyperText Markup Language) code. For instance, content could be organized using paragraphs, a list of bullet points, images, and data tables.

Note that the index. HTML is the text and images that visitors see when they first visit your website are typically contained in this file. One can make a new index file in your text editor. Save it as HTML only, in the test-site folder such as At-the-Concert.pdf.

Learn more about file name from

https://brainly.com/question/26960102
#SPJ1

Other Questions
Identify the terms5b + 6c + 5d + 19a Of the following muscle types, which has only one nucleus, sarcomeres, and gap junctions?a. visceral smooth muscleb. multi-unit smooth musclec. cardiac muscled. skeletal musclee. cardiac muscle Aschli, a member, prepares individual tax returns for about 300 clients during the year. In addition, she prepares approximately 50 business returns. Aschli uses three full-time and two per-diem tax preparers during the busy season to assist her in the preparation of the aforementioned tax returns. Sean Williams has been going to Aschli for the past five years to have joint taxreturns prepared for himself and his wife Madison. Their tax returns for the year 20X6 were completed and filed on April 12, 20X7. Sean and Madison have decided to get a divorce and onJune 16, 20X7 Aschli receives a request from Sean for copies of previously filed tax returns and supporting schedules. On July 12, 20X7 Aschli receives a request from Madison for copies ofthe same returns and supporting schedules. Aschli has never met nor spoken to Madison Williams at any time during Aschli's engagement to prepare the joint tax returns for Sean andMadison Williams. In addition, Sean Williams has requested that information not be provided to Madison Williams. Which of the following statements is true regarding Aschli's obligation toprovide copies to both Sean and Madison Williams as it relates to the rules regarding client confidential information?C) Since Aschli has never met nor spoken to Madison Williams, Aschli is not obligated to provide copies of returns to her and such disclosure would violate confidentiality rules.C) Madison Williams must provide Aschli with a legally enforceable subpoena before Aschli can provide Madison with copies of tax returns.C) Since Aschli has worked exclusively with Sean Williams over the years, Aschli has no obligation to provide copies of returns to Madison Williams and such disclosure would violate confidentialityrules.C) None of the above Question 4 Tele-KC a small competitor of Vodafone Plc is also considering investment into 5G technology. The company is pricing each phone mast and can either lease or buy the machinery. The purchase price is KD 10,000 and the machine has a 5 year life. If it buys the machine Tele- KC will need to fund it using capital that costs them 9% per year. Alternatively the lease payments will be KD 2,100 per year for 5 years with rentals payable at the start of each year. a. What are the respective present value costs of purchasing the machine or leasing it? (5 marks) b. Explain the reasoning for the differences in cost linking to fundamentals of finance theory. (5 marks) c. Critically evaluate the key differences between funding a project via debt or equity finance, from the perspective of the company directors. (10 marks) d. At a recent board meeting one director proclaimed the company should fund all projects with internal sources of financing as they are essentially 'free' using logical arguments and finance theory explain why this statement is incorrect. Clearly explain the cost of each type of finance relative to the risk. the fact that entropy is always increasing is demonstrated by a) A wall consists of wood with a thickness of 2.0 cm. Wood has thermal conductivity 1 = 0.14W / Km. Calculate the U-value. How much power watts disappears from such a wall with an area of 20m The radius of curvature is smaller at the top than on the sides so that the downward centripetal acceleration at the top will be greater than the acceleration due to gravity, keeping the passengers pressed firmly into their seats. What is (a) the speed of the roller coaster at the top of the loop (in m/s) if the radius of curvature there is 13.0 m and the downward acceleration of the car is 1.50 g, and (b) the minimum speed necessary for the coaster to complete the loop without falling off the track? 55. define functional form, simple list, bound variable, and referential transparency. Isabel cut 4 1/2 yards of fishing line from a new reel. How much is this in inches? Which set of numbers contains only rational numbers?O A. (VI. 4)OB. 9.0.45O C. (4. 8.0.25}OD. .3.14. VIZ Which is true of the League of Nations?A. European countries refused to join.B. America became a permanent member at the end of the war.C. Woodrow Wilson rejected the idea as too idealistic.D. America did not join the league. Jackson gave lena this expression to evaluate: 14(8+12) lena said that to evaluate the expression was simple; just multiply the factor 14 and 20. Jackson told lena she was wrong. He solved it by finding the product of 14 and 8, then adding that to the product of 14 and 12 evaluate the expression using each student's method which theory states that a childs growth pattern is related to gene activity? Which BEST describes a similarity or difference in the authors' purposes? A) Douglass' passage reveals that his interest in railroads was greater than Grady's interest in railroads. Eliminate B) Sibley's passage reveals that Grady's interest in railroads was greater than Douglass' interest in railroads. C) Both passages reveal a great interest in one law, one government, and one administration for men of all races. D) Both passages reveal a great interest in railroads during the reconstruction of the South after the Civil War. an allele is: an allele is: one of several forms of a gene. the location of a gene on a chromosome. the particular combination of genes for a given trait in a given organism. the protein product of a specific gene. the expression of a trait in an individual. none of the answer options accurately describes an allele. a wheel, initially at rest, has a moment of inertia of 2.0 kg-m2. if a torque of 30 n-m is applied on the wheel for 10 seconds, how far will the wheel have turned? Jimmy has 9 apples and Johnny ate 2.How many apples doesn Johnny have? DIFFICULT QUESTION which of the following is true about the ftc franchise rule with respect to earnings projections made by a franchisor in materials provided to prospective franchisees? a team of six members have been asked to work together on a report. they are deciding whether one of the members should do all the writing while the others gather information, or whether the entire team should work on the writing together. in this scenario, the team is in the stage of their collaborative writing project. A manufacturing company in city A wishes to truck its product to 4 different cities, B,C,D, and E. If the cities are all interconnected by roads, how many different route plans can be constructed so that a single truck, starting from A, will visit each city exactly once, then return home?