Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program to ask for any amount from 0 to 99. This is the amount of change

ID: 3625235 • Letter: W

Question

Write a program to ask for any amount from 0 to 99. This is the amount of change to be made. The program should calculate the number of quarters, dimes, nickels, and pennies to make the specified change with the fewest coins possible. For example, if the amount is 92 then your program should have output similar to this: Q=3, D=1, N=1. P=2.

1. Make sure YOU can determine the answers with pencil and paper. Write down how you solve the problem (JUST PLAIN OLD ENGLISH).

2. Convert your answer to an ALGORITHM

3. Convert your algorithm to a C++ program

Explanation / Answer

Part 1) First, ask the user for the amount of change, from 0 to 99. Input that into variable 'change'. Divde 'change' by 25 to get the number of quarters. Then set 'change' to 'change' mod 25. Divide 'change' by 10 to get the number of dimes. Set 'change' equal to 'change' mod 10. Divide 'change' by 5 to get the number of nickels. Set pennies equal to 'change' mod 5. Output the number of Pennies, nickels, dimes and quarters. Part 2) quarters = change / 25; change = change % 25; dimes = change / 10; change = change % 10; nickels = change / 5; pennies = change % 5; Part 3) #include using namespace std; int main () { int change, pennies, nickels, dimes, quarters; cout > change; quarters = change / 25; change = change % 25; dimes = change / 10; change = change % 10; nickels = change / 5; pennies = change % 5; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote