The BankAccount class models an account of a customer. A BankAccount has the following instance variables:  A unique account id sequentially assigned when the Bank Account is created.  A balance...


The BankAccount class models an account of a customer. A BankAccount has the following
instance variables:
 A unique account id sequentially assigned when the Bank Account is created.
 A balance which represents the amount of money in the account
 A date created which is the date on which the account is created.
The following methods are defined in the BankAccount class:
 Withdraw – subtract money from the balance
 Deposit – add money to the balance
 Inquiry on:
o Balance
o Account id
o Date created
The SavingsAccount class models a bank account which is meant for long term savings
and earns interest. It inherits all the fields and methods of the BankAccount class. The
SavingsAccount class has an additional instance variable, interest rate. The interest rate is a
decimal representing the rate at which the account earns interest. For example, an interest
rate of .01 means that the account will earn 1% interest on its balance.
The following additional methods are defined in the SavingsAccount class:
 Calculate interest – returns the result of calculating the interest amount based on the
current balance and interest rate. It does not update the balance
 Inquiry on interest rate.
 Modifying the interest rate.
The CheckingAccount class models a bank account which is used to write checks and
make frequent ATM deposits and withdrawals. This type of account does not earn interest.
The CheckingAccount class inherits all the fields and methods of the BankAccount class. It
has an additional instance variable, monthly fee. The monthly fee is an amount of money
charged by the bank for its services.
The following additional methods are defined in the CheckingAccount class:
 Deduct monthly fee – updates the balance by deducting the monthly fee
 Inquiry on monthly fee.
 Modifying the monthly fee.

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here