Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java code for - - This part gives you an opportunity to understand inheritance. You need to use your Account class as attached. You should

java code for -- This part gives you an opportunity to understand inheritance. You need to use
your Account class as attached. You should not modify Account class. You
need to create two new classes: Checking and Saving both inherited from class
Account.
A Checking account has an additional variable to represent number of withdraw
and an additional method to deduct fees. You need to override methods withdraw
method in Checking class. Every time withdraw method is called, increase
number of transaction by 1. A customer receives 3 free transactions. If number of
transaction is more than 3, each additional transaction is charged for $2. It
should be deducted from the account and you need to reset the number of
transaction to zero when the deduct fee method is called.
Add an additional data member to Saving to represent interest rate. All an
additional method to add interest to the account. When this method is called. The
interest will be added to the balance of the account.
You also need to create a class called AccountTest. In this class, you need to
create a Checking account object. You need to deposit or withdraw multiple
times. Make sure withdraw more than 3 time. You then call deduct fees methods
and print out the balance to verify the result. You also need to create a Saving
account object. Call add interest method and print out balance to verify the result

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions