Counting Monetary Units Write a program in the class MonetaryUnits that prompts the user for a double value representing a total number in dollars and cents that is store in a variable called money. The program will classify the given amount of money into smaller monetary units. In particular, the program will report a list of the monetary equivalent in dollars, quarters, dimes, nickels, and pennies, as shown in the sample output. Sample Run: Enter an amount in double for dollars: $11.56 Your amount $11.56 consists of: 11 dollars 2 quarters 0 dimes 1 nickels 1 pennies Please be sure to use the correct variable name and format the output as seen above. The tests will be checking for this.
Counting Monetary Units
Write a program in the class MonetaryUnits that prompts the user for a double value representing a total number in
dollars and cents that is store in a variable called money. The program will classify the given amount of money into
smaller monetary units. In particular, the program will report a list of the monetary equivalent in dollars, quarters,
dimes, nickels, and pennies, as shown in the sample output.
Sample Run:
Enter an amount in double for dollars: $11.56
Your amount $11.56 consists of:
11 dollars
2 quarters
0 dimes
1 nickels
1 pennies
Please be sure to use the correct variable name and format the output as seen above. The tests will be checking for this.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images