CS 117: Introduction to Computer Science
Assignment 3: Change Maker

Assigned on Friday, 1/11/02.
Due on Monday, 1/14/02, electronically, by 5 PM.

Create a class named ChangeMaker with a main method that asks the user for a purchase price and an amount tendered, and then displays the change in dollars, quarters, dimes, nickels, and pennies. The user should enter in both numbers in cents, for example 3450 for $34.50 and 70 for $0.70. Use InputBox for input and OutputBox for output. Display the output in the following format:



 Purchase Price:   $34.5
Amount Tendered:   $40.

 Your change is:   $5.5

                   5 one-dollar bill(s)
                   2 quarter(s)

Thank you for your business. Come back soon.


Your answer should be the natural one, i.e. the one that gives away as little small change as possible. You may assume that both the purchase price and the amount tendered is less than $100, and greater or equal to $0.

Good luck!

Assignment from C. Thomas Wu, An Introduction to Object Oriented Programming With Java, McGraw-Hill, 2001.