i have some problems that i need help with.
would just putting:
quarter = .25 number % quarter
dime = .1 afterQuarters = number - ( numQuarters*quarter ) afterQuarters % dime
nickel = .05 afterQuarters = number - (numQuarters*quarter) afterQuarters % nickel
penny = .01 afterQuarters = number - (numQuarters*quarer) afterQuarters % penny
in the code work, or do I have to do something to it? That is the formula, and i was tryng to make it work with the code. I do not know if it will just draft in though. maby i have to surround it in other code, i dont know...
Also, i have made the simple 'stilted' way of showing the results. How do you make it 'non-stilted' I have tried many else if statements, but so far i got long confusing else ifs that probably will not work. And the ones that are simple i dont know how to combine them, like here
if (pennies = 0)
cout << number << 'requires' << quarter << 'quarters,' << dime << 'dimes, and' << nickel << 'nickels' <<endl;
cout << endl;
else if (pennies < 0)
cout << number << 'requires' << quarter << 'quarters,' << dime << 'dimes,' << nickel << 'nickels, and' << penny <<'pennies'<<endl;
cout << endl;
If i do that, i dont know how to draft the rest of the money types with it. Do i just do
if (pennies = 0) || (nickels = 0) || (dimes = 0)
etc...? or what?
and when i say stilted, here is an example
58 cents requires 2 quarters, 0 dimes, 1 nickels, 3 cents.
the non tilted way would appear like this
58 cents requires 2 quarters, 1 nickel, 3 cents