Thread: Change.cpp help
View Single Post
Old 10-27-2004, 04:51 PM   #1 (permalink)
verdell32
Registered User
 
verdell32's Avatar
 
Join Date: Oct 2004
Posts: 35
verdell32 is on a distinguished road
Change cpp here's the code again

We are learning in Borland C++ 5 so I am trying to teach myself at the same time in Visual C++.NET 2003.


Write a program that inputs the amount of a sale and an amount tendered by a customer. The program should then calculate the total amount of change due and display the same. Then the program should calculate the individual bills and coins that would be used to give change back to a customer.

Sample output: Another example:

Amount tendered : $50.00 Amount tendered : $200.00
Amount of sale : $12.13 Amount of sale : $121.62
Your total change: $37.87 Your total change: $ 78.38
--------------------------------- -----------------------------------
$50 0 1 fifty
$20 1 1 twenty
$10 1 0 tens
$ 5 1 1 five
$ 1 2 3 ones
50¢ 1 0 half dollars
25¢ 1 1 quarter
10¢ 1 1 dime
5¢ 0 0 nickels
1¢ 2 3 pennies

Thanks for all your help.

Last edited by verdell32; 10-29-2004 at 12:37 PM. Reason: update
verdell32 is offline   Reply With Quote