Write a program that will prompt the user for a purchase amount. If this bill amount is valid, then prompt the user again for the payment amount. If this is valid then compute the change to be returned. This amount should be displayed in 1 fils, 5 fils, 10 fils, 20 fils, 50 fils, 100 fils, quarter dinar, half dinar, one dinar, five dinar, ten dinar and twenty dinar. If either of the input values are invalid, an error message should be displayed explaining precisely where the error is. Do NOT display bills or coins that will not be returned. Send your output to a file called "Output.dat".
for (int b = 0; b < 4; b++) subtract_banknotes(banknoteDenominations[b], change, out); for (int c = 0; c < 8; c++) subtract_coins(coinDenominations[c], change, out);
Comments
Leave a comment