# Question Solved1 AnswerCHALLENGE 2.11.3: Integer division and modulo. ACTIVITY 345198 1467878.qx3zqy7 Jump to level 1 Convert totalPennies to dimes, nickels, and pennies, finding the maximum number of dimes, then nickels, then pennies. Ex: If the input is 56, the output is: Dimes: 5 Nickels: 1 Pennies: 1 Note: A dime is 10 pennies. A nickel is 5 pennies. 5 int totalPennies; 6 int CHALLENGE 2.11.3: Integer division and modulo. ACTIVITY 345198 1467878.qx3zqy7 Jump to level 1 Convert totalPennies to dimes, nickels, and pennies, finding the maximum number of dimes, then nickels, then pennies. Ex: If the input is 56, the output is: Dimes: 5 Nickels: 1 Pennies: 1 Note: A dime is 10 pennies. A nickel is 5 pennies. 5 int totalPennies; 6 int numDimes; 7 int numNickels; 8 int numPennies; 9 cin >> totalPennies; numDimes totalPennies / 10; 13 14 15 numNickels = numDimes / 5; 16 17 numPennies numNickels / 1; 10 11 12 ANTGANGSING 18 19 20 21 22 23 cout << "Dimes: " << numDimes << endl; cout << "Nickels: " << numNickels << endl; cout << "Pennies: " << numPennies << endl; return 0: > < 3

K7DBK3 The Asker · Computer Science

Transcribed Image Text: CHALLENGE 2.11.3: Integer division and modulo. ACTIVITY 345198 1467878.qx3zqy7 Jump to level 1 Convert totalPennies to dimes, nickels, and pennies, finding the maximum number of dimes, then nickels, then pennies. Ex: If the input is 56, the output is: Dimes: 5 Nickels: 1 Pennies: 1 Note: A dime is 10 pennies. A nickel is 5 pennies. 5 int totalPennies; 6 int numDimes; 7 int numNickels; 8 int numPennies; 9 cin >> totalPennies; numDimes totalPennies / 10; 13 14 15 numNickels = numDimes / 5; 16 17 numPennies numNickels / 1; 10 11 12 ANTGANGSING 18 19 20 21 22 23 cout << "Dimes: " << numDimes << endl; cout << "Nickels: " << numNickels << endl; cout << "Pennies: " << numPennies << endl; return 0: > < 3
More
Transcribed Image Text: CHALLENGE 2.11.3: Integer division and modulo. ACTIVITY 345198 1467878.qx3zqy7 Jump to level 1 Convert totalPennies to dimes, nickels, and pennies, finding the maximum number of dimes, then nickels, then pennies. Ex: If the input is 56, the output is: Dimes: 5 Nickels: 1 Pennies: 1 Note: A dime is 10 pennies. A nickel is 5 pennies. 5 int totalPennies; 6 int numDimes; 7 int numNickels; 8 int numPennies; 9 cin >> totalPennies; numDimes totalPennies / 10; 13 14 15 numNickels = numDimes / 5; 16 17 numPennies numNickels / 1; 10 11 12 ANTGANGSING 18 19 20 21 22 23 cout << "Dimes: " << numDimes << endl; cout << "Nickels: " << numNickels << endl; cout << "Pennies: " << numPennies << endl; return 0: > < 3