CS 107: Change Maker

Assigned on Friday, 10/18.
Due on Friday, 10/25, electronically, by 4 PM. Note that the lab closes at 5 PM.

Your job is write the files "changemaker.html" and "changemaker.php". changemaker.html should present a form that asks the user for a purchase price and an amount tendered, and presents a button for the user to click when the information has been entered. This button should trigger changemaker.php, which displays the change in dollars, quarters, dimes, nickels, and pennies. The user should enter in both numbers as standard decimal values without a "$" sign (e.g. 34.50, 0.70, etc.) Display the output in the following format:



Purchase Price: $34.50
Amount Tendered: $40.00
Your change is: $5.50
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 are greater than or equal to $0. You may also assume that the amount tendered is greater than the purchase price.

Check out the function floor at www.php.net. It may help.

Good luck!