Question: (The Checking class) Design and implement a class named Checking that extends the Account class and contains: A constructor that creates a checking account with

(The Checking class) Design and implement a class named Checking that extends the Account class and contains:

A constructor that creates a checking account with an initial balance.

Change the id attribute to a String and the associated accessor return type to String and the paramater for the mutator to String.

A method named toString that returns the following string representation of the class: Account Type: Checking, Account #: [Account Id], Balance: [Balance], Rate: [interestRate];

NOTE: [Text] should be replaced with actual values.

(The Savings class) Design and implement a class named Savings that extends the Account class and contains:

A private double data field named interestRate for the account (default 0).

A constructor that creates a savings account with the specified interest rate.

Change the id attribute to a String and the associated accessor return type to String and the paramater for the mutator to String.

A method named toString that returns the following string representation of the class: Account Type: Savings, Account #: [Account Number], Balance: [Balance], Rate: [interestRate];

NOTE: [Text] should be replaced with actual values.

(The Driver class)

Write a main program that instantiates a checking account object and savings account object. The checking account should be created with a balance of $100 and a savings account with a balance of $200 and an interest rate of 1.5. Print the resulting accounts using the toString() method. Then, proceed with withdrawing $50 from savings and depositing $50 into checking. Print the resulting accounts using the toString() method.

Sample 1

Account Type: Checking, Account #: 2014-12345, Balance: 100.0

Account Type: Savings, Account #: 2014-12344, Balance: 200.0, Rate: 1.5

Account Type: Checking, Account #: 2014-12345, Balance: 50.0

Account Type: Savings, Account #: 2014-12344, Balance: 250.0, Rate: 1.5

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!