Elections are coming, so let us help maintain the elections.

1. The names of the three candidates are stored in the variable *name1*,
*name2*, and *name3*; the number of votes that each of them
received is stored, correspondingly,
in the variables *votes1*, *votes2*, and *votes3*.
Use *if-statements* to write down a code
that, given this information, prints the name of the winning candidate and
the number of votes received by this candidate.

*Hint:* You do not need to read anything from the keyboard or
from a file, just compute and print. Assume that the variables *name1*,
*name2*, *name3*, *votes1*, *votes2*, and
*votes3* have
been assigned some values already.

2. Suppose that the name of the currently winning candidate is stored in the variable

*Example:* if *name1* is "Nixon", *name2* is "Kennedy",
*votes1* = 200, and *votes2* = 300, then after your code,
*name1* should contain "Kennedy", *name2* should contain "Nixon",
*votes1* should contain 300, and *votes2* should contain 200.

*Trace your
code*, step by step, on this example: draw all the boxes and show how
their values change after each operation.

3. A person is eligible to vote if he or she is a US citizen, at least 18 years old, and not a convicted felon. Assume that we have a boolean variable

4. Many voters do not understand the important of education. As a result, the state funding for universities goes down, and because of that, tuition has to increase. To avoid this problem, the students proposed a new law according to which only those who know math can vote. To show the knowledge of math, voters must print the squares of all the numbers from 5 to 8. Write down a program that use the for-loop for this computation. Trace your program step by step.

*Comment*: no need to be too wordy, just draw the boxes corresponding
to all the variables, and show how the values of these variables change
and what values will be printed.

5. The following algorithm can be used to convert a decimal positive integer

*Example of conversion:* for *n* = 13, we have

13 / 2 = 6 rem 1 6 / 2 = 3 rem 0 3 / 2 = 1 rem 1 1 / 2 = 0 rem 1When we read the remainders from bottom to top, we get 1101, which is exactly the binary representation of 13 -- since 1 * 8 + 1 * 4 + 0 * 2 + 1 * 1 = 8 + 4 + 1 = 13.

Use this algorithm to *convert* number 82 into the binary form.
*Check* the result by converting the binary number back into the decimal
code.

*Reminder:* 137 in the decimal form means 1 * 10^2 + 3 * 10^1 + 7 * 10^0.
Similarly, 101 in the binary form
means 1 * 2^2 + 0 * 2^1 + 1 * 2^0 = 1*4 + 0*2 + 1*1 =
4 + 1 = 5.

*For extra credit:* write down a code that converts a decimal number
into the binary form (and returns this binary form as a string).