Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java Please Objective: In this lab, you'll be creating software for the world's smallest bank. This bank can have only one customer. The customer

In java Please

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Objective: In this lab, you'll be creating software for the world's smallest bank. This bank can have only one customer. The customer will have a checking account and a savings account. The account types have some specific rules: Checking Accounts: - Allows unlimited deposits and withdrawals for free. - Provides no interest payments. If the account balance ever drops below $0, the customer is charged a $20 overdraft fee. Saving Accounts: - Must maintain a $500 balance at all times, otherwise the customer is charged $10 each time they make a withdrawal that lowers their balance below $500. - Earns 1.5% interest every year The first 5 deposits are free, after that there is a fee of $10 per deposit. You'll provide the bank teller with a simple menu which will allow them to make changes to their customer's accounts. You'll use your IDE to generate UML diagrams of your classes. See UML section below. Account Numbers: Each account will have an account number. You should use a static variable to keep track of the next account number. At the start set this number to 10001. In your driver you'll create a Checking account, and a Savings account. The checking account will end up with a account_number of 10001, while the Savings account will end up with an account_number of 10002. Classes Create a class called Account. This will hold things that are true for all account types. Be sure to include at least: An attribute which will hold the account number. An attribute which will hold the account balance. (e.g. $500.22) O A constructor method which opens the account with a balance of 0. It should set the account number using the static variable described above. An overloaded constructor which opens the account with a specific amount which is passed to the constructor. It should set the account number using the static variable described above. o Getter method for accessing the account_number. Getter/Setter method for accessing the account balance. A withdrawal method which takes a parameter of the amount to be withdrawn and deducts it from the balance. o A deposit method which takes a parameter of the amount to be deposited and adds it to the balance Create a class called "Checking" which should inherit from Account. You will need an appropriate constructor to set the account balance, o Modify the withdrawal method you inherited to check for the condition where they try to overdraft their account. If an overdraft condition occurs you should print out Charging an overdraft fee of $20 because account is below $0" Deduct $20 from their balance. Create a class called "Savings" which should inherit from Account You will need an appropriate constructor to set the account balance. Modify the withdrawal method so it implements the rules about dropping below $500 If they drop below $500, you should print "Charging a fee of $10 because you are below $500" Deduct $10 from their balance. o Modify the deposit method so it implements the charge for more than 5 deposits. As you do the deposit you should print This is deposit 1 to this account, where I would be updated to reflect what number deposit this is. If you are doing the 6th or later deposit, print "Charging a fee of $10", and deduct $10 from their balance. Add a method which adds 1.5% interest to the account. (This method will be called by Add a method which adds 1.5% interest to the account. (This method will be called by the teller manually once per year). Print out how much the customer earned in interest as follows "Customer earned 15.25 in interest". Of course it should reflect the actual amount. Add the interest earned to their balance. All classes should be created with appropriate encapsulation. i.e. account balances and account numbers should be private and only accessible via getters/setters. Don't worry if the formatting of the dollar figures. Ie, sometimes the interest will be 2.585828225 and that's ok. Likewise sometimes the balance will be 100.5 and that's ok for this lab. Driver: Create a driver class which creates a checking and savings account. Then keep prompting the user with the following menu until they quit: 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit Each menu choice should prompt the user as appropriate to do what it says, i.e. if the user selects Deposit to Checking, they should be prompted for the amount. See sample output below

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

Step: 3

blur-text-image

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

1. \fLet f(z) = (- 2x2 +9) (-622+8)" f' (z) =

Answered: 1 week ago

Question

1. Television more Over watching faceing of many problems ?

Answered: 1 week ago

Question

Is there a link between chronic stress and memory function?

Answered: 1 week ago