Question Solved1 Answer 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 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
See Answer
Add Answer +20 Points
Community Answer
QH6SVN The First Answerer
See all the answers with 1 Unlock
Get 4 Free Unlocks by registration

General GuidanceThe answer provided below has been developed in a clear step by step manner.Step: 1Ans: Let's implement the given problem in the C++ programming language with comments to understand the code easily.First, declare four integer variables.After that, take the value from the user of the totalPennies variable.Then, calculate the numDimes, numNickels, and numPennies variable as per the conversion rules.In the last, print all these values to the user as per the final results.Explanation:ExplanationUse the above procedure to solve this problem in C++.Step: 2C++ code:#include &lt;iostream&gt;using namespace std;int main(){ //Declare four integer variables... int totalPennies; int numDimes; int numNickels; int numPennies; //Take the value of the totalPennies variable... cin &gt;&gt; totalPennies; //Calculate the numDimes as totalPennies ... See the full answer