Here are the answers to the questions:
Question 1
The correct option to allow the user to input the amount paid and modify the program accordingly is: Add a line below line 1 and enter the following on it: amountPaid = int(input("How much did you pay in cents?")) , then change the 100 in the amountOwed calculation to amountPaid.
Question 2
The turtle drawing will create the shape:
M
The movements of the turtle will form the outline of the letter "M".
Question 3
The result of the code print(0.1 + 0.1 + 0.1)
will be:
0.30000000000000004
This outcome happens due to floating-point precision errors in binary representation.
Question 4
The reason for the result in the previous question is: It is not simple to store fractions and decimals in binary, and oftentimes even the simplest decimals end up with a repeating component in their binary representation.
Question 5
For the inputs of 2.5 and 3.4, the output of the code will be:
2.95
The calculation (x + y) / 2
will yield (2.5 + 3.4) / 2 = 5.9 / 2 = 2.95
.
Let me know if you need any further assistance!