Develop a program that classifies a given amount of money into smaller monitory units. The program lets
Question:
Develop a program that classifies a given amount of money into smaller monitory units. The program lets the user enter an amount as a floating-point value representing a total in dollars and cents, and then outputs a report listing the monetary equivalent in dollars, quarters, dimes, nickels and pennies, as shown in the sample run.
Guidelines:
Prompt the user to enter the amount as a decimal value, such as (11.56).
Convert the amount (11.56) into cents (1156).
Using integer division (//), divide cents by 100 to find number of dollars.
Using remainder (%) by 100 to obtain the remaining cents.
Using integer division (//), divide the remaining cents by 25 to find number of quarters.
Using remainder (%) by 25 to obtain the remaining cents.
Using integer division (//), divide the remaining cents by 10 to find number of dimes.
Using remainder (%) by 10 to obtain the remaining cents.
Using integer division (//), divide the remaining cents by 5 to find number of nickels.
Using remainder (%) by 5 to obtain the remaining cents.
The remaining cents are the number of pennies.
Example run:
Enter an amount: for example, 11.56:
Your amount is 11.56 consists of:
11 dollars
2 quarters
0 dimes
1 nickel
1 penny
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall