hi there!
can somebody help me with a problem i can't seem to solve.
my professor has asked me to create a C++ source file that acts as a cashier in a store. the program should total the amount of items and receives an amount from the user. of course, it will compute for the amount of change to be give.
the only thing i can't seem to handle is the breakdown of the amount of change to be given. it should display the quantity of each bill or coins to be given back as change.
If the amount of change is X dollars and Y cents, then
the number of dollar bills returned is equal to X;
the number of quarters returned is Y / 25;
the number of dimes returned is equal to the amount left over after returning quarters / 10;
etc.
If the amount of change is X dollars and Y cents, then
the number of dollar bills returned is equal to X;
the number of quarters returned is Y / 25;
the number of dimes returned is equal to the amount left over after returning quarters / 10;
etc
its still unclear to me.
lets say the change is 2720.
so there would be 2 thousand bills
1 five hundred
1 two hundred
and a twenty bill.