Program-computing coins needed to make change for purchase


Question 1) Design computer program which calculates minimum number of coins and bills required to make change for the particular purchase. You must prompt the user for the cost of the item and amount tendered. Your program must indicate how many coins and bills of each denomination are required for change. Make use of these denominations.

Coins: $0.01, $0.05, $0.10, $0.25, $1, $2

Bills: $5, $10, $20, $50, $100

Your program must be able to process one set of input data at a time. You must run your program for all the given data sets to see if it would give you the proper output.

You should input from the file and output to the file. Use end of file function for the loop input.

You should use a function to input and do the data validation. Use one function to do the change and one function to do the output. Ensure the output format is exactly the same as given in this assignment.

An suitable error message must be printed for any invalid input data, that is, if the cost is less than or equal to 0.0, or if the amount tendered is less than the cost.

You must hand in a user documentation and a programmer documentation including storage layouts and a variable list (showing all variables and their meanings.)

Use the following input data sets. The first column is for 'cost' and the second column is for 'money tendered'. Your output must look like the sample output.

Use 'divide' and 'modulus' function for integers. You could convert everything to cents to avoid rounding errors.

SAMPLE OUTPUT

cost tendered change: $10 $5 $2 $1 $0.25 $0.10 $0.05 $0.01

10.50 20.00
3.00 10.00
2.50 5.00
4.80 10.00
3.33 5.00
1.99 1.00
0.29 1.00
6.53 10.00
0.00 10.00
5.00 0.25
9.99 10.00
10.89 11.00

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Program-computing coins needed to make change for purchase
Reference No:- TGS04680

Expected delivery within 24 Hours