Question: please help me with number 3 question (in java program language) 2.Implement a class Account. An account has a balance, functions to add and withdraw

please help me with number 3 question (in java program language)

2.Implement a class Account. An account has

a balance,

functions to add

and withdraw money,

and a function to inquire the current balance.

Pass a value into a constructor to set an initial balance.

If no value is passed the initial balance should be set to $0.

Charge a $5 penalty if an attempt is made to withdraw more money than available in the account. Enhance the Account class to compute interest on the current balance.

---------------------------------------------------

3. Implement a class Bank.

This bank has two objects

checking and savings

of the type Account that was developed in the preceding exercise.

Implement four instance methods:

deposit(double amount, String account)

withdraw(double amount, String account)

transfer(double amount, String account)

printBalances()

Here the account string is "S" or "C". For the deposit or withdrawal, it indicates which account is affected. For a transfer it indicates the account from which the money is taken; the money is automatically transferred to the other account.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!