Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CISC 225 Java Programming Assignment 7 Create a class named Account for a bank. Include a String field for the account number, a String field

CISC 225 Java Programming

Assignment 7

Create a class named Account for a bank. Include a String field for the account number, a String field for the name on the account, and a double field for the account balance. Also include one constructor that requires an account number as a parameter and sets the name to null, and the balance to $0, and a second constructor that receives all values as parameters (no default constructor is necessary since a bank account would never be created without an account number). Include set methods for the balance and name, and three get methods (one for each field). Add an equals method and a print method to print the account.

Create two sub-classes of Account: Checking and Savings.

Within the Checking class, add an instance variable for check number (starts at check number 1), create the required constructors, set and get methods, and a print method that displays the String Checking account information, the account number, current check number, account holder, and balance.

Within the Savings class, add an instance variable to hold the interest rate, create the required constructors, set and get methods, and a print method that displays the String Savings account information, the account number, account holder, balance, and interest rate. Add a method to calculate and return the current monthly interest (rate * balance / 12).

Write a main program that will create a bank to test your new classes. Create an array to hold ten of each type of account. Be sure to send the correct arguments to the constructors for each class. Print a menu on the screen for the bank teller that presents the options associated with each account. You should put your menus in a tiered structure, for example:

1. Create new account

2. Modify an existing account

3. Print an account

Please enter choice: 1

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

1. Create new checking

2. Create new Savings

3. Return to main menu

Please enter choice: 2

At this point present the user with the necessary information to create the correct account type.

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

Sql All In One For Dummies 7 Books In One

Authors: Allen G Taylor ,Richard Blum

4th Edition

1394242298, 978-1394242290

More Books

Students also viewed these Databases questions