CSC111 Midterm Exam Preparation 2015

From dftwiki3
Revision as of 20:05, 28 February 2015 by Thiebaut (talk | contribs)
Jump to: navigation, search

--D. Thiebaut (talk) 18:08, 28 February 2015 (EST)


Midterm Exam Prep

The midterm is an in-class exam given under the rules of the honor code. It lasts 70 minutes. It will be closed books, closed notes, closed computers.



...


Question 8


amount = float( input( "Enter amount: " ) )

Continue writing code that will output the number $5, $1, and quarters that makes up the amount entered by the user. We assume the user can enter integer numbers or real numbers. 21 is a valid input. 7.76 is also valid. For the first number, your program will output 4, 1, 0, indicating that 4 $5-bills, 1 $1-bill, and 0 quarters. For the second number, the program will output 0, 1, 2, 3, indicating 0 $20-bills, 1 $5-bill, 2 $1-bill, and 3 quarters.