1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
/*int main()
{*/
int ones, fives, tens, twenties, temp,;//remove the final comma; it just needs a semi-colon
twenties = (dollars/20);/*change this to *twenties = ((dollars-(dollars%20))/20;*
without the asterisks, since it would otherwise give a decimal (this way, when you input
24, it will do (24-4)/20 versus 24/20)*/
temp = (dollars%20);/*make this instead *temp = dollars-(twenties*20);* without the \
asterisks, so that the temp value is equal to the remainder left over after you broke it
into 20 dollar bills*/
tens = (temp/10);//same as with twenties, but replace dollars with temp like you did
temp = (temp%10);//same with the first temp
fives = (temp/5);//same as with tens
ones =(temp%5);//this is fine, actually, with the prior revisions
cout <<"The dollar amount of", dollars, " can be represented by the following monetary denominations" >> cin>>;/*replace the commas outside of the quotes with "<<"'s, add
a colon after "denominations" inside of the quotes (grammatical nitpicking), and replace
">>cin>>;" with "<< endl;" so that it makes a new line versus asking for another
input*/
cout << " twenties:", twenties, tens:", tens, fives:",fives, ones:", ones " >>
<<cin>>/* replace commas with "<<"'s, make sure that all words that are stated are fully encapsulated in quotation marks, and replace everything after the "s" in the
"ones" outside of quotation marks with a semi-colon*/
return 0;
}
|