Question: Assignment 2 Write a program that displays change due back to a customer. The program should prompt user to enter total pennies as the change

Assignment 2 Write a program that displays change due back to a customer. The program should prompt user to enter total pennies as the change due back to a customer and then it will display total pennies in the form of quarters, dimes, nickels, and pennies. For instance, if user enters 97 pennies, the program should display 3 quarters, 2 dimes, 0 nickel, and 2 pennies. To Solve this problem, we can identify IPO and develop the Pseudocode. Input Total pennies to convert, in this case, we use 97 pennies Processing To convert the given pennies to quarters, dimes, nickels, and pennies in this order. Output Display the result for each coin denomination. Variables total_pennies, remaining_pennies, quarters, dimes, nickels - all are integer type Constants PENNY TO QTR = 25, PENNY TO DIME = 10, PENNY TO NICKEL = 5 Detail 1. Prompt the user to enter total pennies. Pseudocode 2. Convert to quarters first: quarters = total_pennies / PENNY_TO_QTR 3. Calculate the remaining pennies after you convert to quarter. Use the remaining pennies to get total dimes. 4. After dime conversion, figure out the remaining pennies again and then get total nickels. 5. Figure out the final remaining pennies. 6. Display quarters, dimes, nickels, and remaining pennies. Use the above pseudocode, you can map to Python code. Assignment Instructions: 1. Create a Python program and name it First_Last_A2.py. (First is your first name, and Last is your last name) 2. Submit your file in Canvas for grading 3. Name your variables clearly 4. Add comments to document your code 5. Program output is as follows: Program output: Enter total pennies: 97 Total pennies to convert: 97 Total Quarters: 3 Total Dimes: 2 Total Nickels: 0 Total Pennies: 2
Step by Step Solution
There are 3 Steps involved in it
Sure lets work through the solution and implement the pseudocode into a Python program Here is a sam... View full answer
Get step-by-step solutions from verified subject matter experts
