Hello all, I have this code I've been working on today and I'm stuck. I'm asking for help with, how to write this code to a file while using the 6 inputs I have for cost and payment(think its called reading to a file) and removing the zeros on the rows where there isn't any in the column. IE: 1.00 = 4 quarters 0 dimes 0 nickels 0 pennies. How do I include only the ones with values?
You've entered the Make Change Program
What's the change? .81
You have $ 0.81 change.
(TOTAL PENNIES: 81)
Your change is:
HALF DOLLARS: 1
QUARTERS: 1
NICKELS: 1
PENNIES: 1
Why did I do a static_cast (line 31)?
To shut up a warning about a "conversion from 'float' to 'int', possible loss of data."
This is a basic class, we aren't allowed to use while loop yet.
I guess I worded my question wrong. I need to understand how to take my inputs(from my paper) and have them within my code. I thought of making them all const but that would be a lot of code writing. There are 6 costs and 6 payments.
I need to read them into my code. or print them to file. I'm just either overthinking or just not grasping the concept yet.
I wasn't meaning you said "while" I was just saying in this class we haven't covered that yet. So far we have " IF, IF/Else, ELSE IF, and SWITCH. I can't use anything else.
I appreciate your ONE change making operation. But I can't proceed any further until i can understand how to read or print to this output file my input data.
You've entered the Make Change Program
Enter the COST: 50
Enter the PAYMENT: 100
Your change is: $ 50
TWENTIES: 4199040
TENS: -1371538021
FIVES: 1975156762
ONES: 1975156771
QUARTERS: 8
DIMES: 1975219825
NICKELS: 7208668
PENNIES: 1975538752
Process returned 0 (0x0) execution time : 7.457 s
Press any key to continue.