Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

specs for ClassifyPennies Write a class called ClassifyPennies This class must contain a main method what it does: 1. ask the user for an amount

specs for ClassifyPennies

 Write a class called ClassifyPennies This class must contain a main method what it does: 1. ask the user for an amount of money specified in dollars and cents. 2. your program must output maximum number of dollar bills that fit in the amount, then the maximum number of fifty dollar bills, then 20, 10, 5 and 1. After that, display maximum number of quarters, number of dimes, nickels and pennies. 3. For example $100 could be displayed as 10000 pennies, or 2 fifty dollar bills or 5 twenty dollar bills. But the correct answer is the maximum number of 100 dollar bills first: 1 one hundred dollar bill. HINT: if the amount is 23 23/20 = 2 is the number of 20 dollar bills the remainder is 23% 20 = 3 3/10 = 0 is the number of 10 dollar bills the remainder is 3%10 = 3 3/5 = 0 is the number of 5 dollar bills the remainder is 3%5 = 3 3/1 = 3 is the number of 1 dollar bills the remainder is 3%1 = 0 

Examples:

% java ClassifyPennies enter amount of money with at most 2 decimal places: 100 1 100 dollar bills 0 50 dollar bills 0 20 dollar bills 0 10 dollar bills 0 5 dollar bills 0 1 dollar bills 0 quarters 0 dimes 0 nickels 0 pennies % java ClassifyPennies enter amount of money with at most 2 decimal places: 100.01 1 100 dollar bills 0 50 dollar bills 0 20 dollar bills 0 10 dollar bills 0 5 dollar bills 0 1 dollar bills 0 quarters 0 dimes 0 nickels 1 pennies % java ClassifyPennies enter amount of money with at most 2 decimal places: 150.06 1 100 dollar bills 1 50 dollar bills 0 20 dollar bills 0 10 dollar bills 0 5 dollar bills 0 1 dollar bills 0 quarters 0 dimes 1 nickels 1 pennies % java ClassifyPennies enter amount of money with at most 2 decimal places: 975.23 9 100 dollar bills 1 50 dollar bills 1 20 dollar bills 0 10 dollar bills 1 5 dollar bills 0 1 dollar bills 0 quarters 2 dimes 0 nickels 3 pennies % java ClassifyPennies enter amount of money with at most 2 decimal places: 98765.21 987 100 dollar bills 1 50 dollar bills 0 20 dollar bills 1 10 dollar bills 1 5 dollar bills 0 1 dollar bills 0 quarters 2 dimes 0 nickels 1 pennies % java ClassifyPennies enter amount of money with at most 2 decimal places: 254.67 2 100 dollar bills 1 50 dollar bills 0 20 dollar bills 0 10 dollar bills 0 5 dollar bills 4 1 dollar bills 2 quarters 1 dimes 1 nickels 2 pennies % java ClassifyPennies enter amount of money with at most 2 decimal places: 186.41 1 100 dollar bills 1 50 dollar bills 1 20 dollar bills 1 10 dollar bills 1 5 dollar bills 1 1 dollar bills 1 quarters 1 dimes 1 nickels 1 pennies %

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions