Question: CHALLENGE ACTIVITY 2 . 1 1 . 2 : Integer division and modulo Jump to level 1 Convert totalPennies to dimes, nickels, and pennies, finding
CHALLENGE
ACTIVITY
: Integer division and modulo
Jump to level
Convert totalPennies to dimes, nickels, and pennies, finding the maximum number of dimes, then nickels, then pennies.
Ex: If the input is then the output is:
Dimes:
Nickels:
Pennies:
Note: A dime is pennies. A nickel is pennies.
int main
int totalpennies;
int numDimes;
int numNickels;
int numPennies;
cin totalPennies;
numDimes totalPennies ;
numPennies
numNickels totalPennies &;
numPennies numNickels &;
cout "Dimes: numDimes endl;
cout "Nickels: numNickels endl;
cout "Pennies: numPennies endl;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
