Doraemon has a LOT of money. He has n dollars in the bank. For security reasons, he wants to withdraw it in cash. The denominations for dollar bills are 1, 5, 10, 20, 100. What is the minimum number of bills Doraemon could receive after withdrawing his entire balance? Instruction: Create a java program that determines the minimum number bills Doraemon will receive using inheritance as shown in the figure. Explain your codes using comments. Main class Creates an instance of "Bill" Input class and call the methods in balance int sequence as shown in the figure. Main in() ● obj.in(): - Input class It contains a method in() that ask for the balance that needs to be obj.bill_1000); Bill obj.bill_500): withdraw. count: int obj.bill_200): Bill class It contains the methods that - • obj.bill_100): bill_100() obj.bill_50): bill_500) and computes displays the denominations for each dollar bills (100, 50, 20, 10, 5, 1) and displays bill_200) obj.bill_1(): obj.total(): bill_100) the minimum number of bills bill_50) that Doraemon could receive. bill_1() total()

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Doraemon has a LOT of money. He has n dollars in the bank. For security reasons, he wants to
withdraw it in cash. The denominations for dollar bills are 1, 5, 10, 20, 100. What is the minimum number
of bills Doraemon could receive after withdrawing his entire balance?
Instruction: Create a java program that determines the minimum number bills Doraemon will receive
using inheritance as shown in the figure. Explain your codes using comments.
Main class Creates an instance of "Bill"
Input
class and call the methods in
sequence as shown in the figure.
balance int
Main
in()
obj.in():
●
Input class - It contains a method in() that
ask for the balance that needs to be
withdraw.
obj.bill_1000);
Bill
obj.bill_500):
count: int
obj.bill_200):
obj.bill_100):
bill_100()
obj.bill_50):
bill_500)
Bill class It contains the methods that
computes and displays the
denominations for each dollar bills
(100, 50, 20, 10, 5, and displays
the minimum number of bills
that Doraemon could receive.
bill_200)
obj.bill_1():
obj.total();
bill_100)
bill_50)
bill_10
total()
Sample Output:
run:
Enter the balance to withdraw: 125
No of 100 bills: 1
No of 50 bills: 0
No of 20 bills: 1
No of 10 bills: 0
No of 5 bills: 1
No of 1 bills: 0
The minimum number of bills that Doraemon could receive: 3
Transcribed Image Text:Doraemon has a LOT of money. He has n dollars in the bank. For security reasons, he wants to withdraw it in cash. The denominations for dollar bills are 1, 5, 10, 20, 100. What is the minimum number of bills Doraemon could receive after withdrawing his entire balance? Instruction: Create a java program that determines the minimum number bills Doraemon will receive using inheritance as shown in the figure. Explain your codes using comments. Main class Creates an instance of "Bill" Input class and call the methods in sequence as shown in the figure. balance int Main in() obj.in(): ● Input class - It contains a method in() that ask for the balance that needs to be withdraw. obj.bill_1000); Bill obj.bill_500): count: int obj.bill_200): obj.bill_100): bill_100() obj.bill_50): bill_500) Bill class It contains the methods that computes and displays the denominations for each dollar bills (100, 50, 20, 10, 5, and displays the minimum number of bills that Doraemon could receive. bill_200) obj.bill_1(): obj.total(); bill_100) bill_50) bill_10 total() Sample Output: run: Enter the balance to withdraw: 125 No of 100 bills: 1 No of 50 bills: 0 No of 20 bills: 1 No of 10 bills: 0 No of 5 bills: 1 No of 1 bills: 0 The minimum number of bills that Doraemon could receive: 3
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY