Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop three classes called Bank, Account, and Customer to store account information and its customer information for a bank. Bank Class Your Bank class should

Develop three classes called Bank, Account, and Customer to store account information and its customer information for a bank.

Bank Class

Your Bank class should have a maximum of five accounts. For the openAccount() method, your class should add a new account with the account number (accNum) and the corresponding information. Additionally, your method should put the customer information with the SSN number in the Account object. If the account number is already taken by another object or the bank already has too many accounts (= five), your method should return false. Furthermore, if a customer with the SSN already has an account in the bank, your method should return false as well.

For the closeAccount() method, your class should delete the account with the account number (accNum) from the bank. If the account number doesnt exist in the bank, your method should return false.

For the accountInfo() method, your class should display the account information with the corresponding customer information. If the account number doesnt exist in the bank, your method should return false.

For the updateBalance() method, your class should change the balance with the new amount for the account number. If the account number doesnt exist in the bank or the balance is a negative number, your method should return false.

For the updateAddress() method, your class should update the address of the customer with the account number. If the account number doesnt exist in the bank, your method should return false.

Account Class

Note:

For accType, 1 is checking and 2 is savings.

accountholder holds the Customer object for the account.

One Account object can have only one account holder (= Customer).

Customer Class

A sample run of your program should look like:

========== Three New Accounts ==========

========== Bank Info ==========

Bank Name: CSUMB

Number of Accounts: 3

1000: $10.00 - Tom Smith: 77777

2000: $50.25 - Alice Smith: 88888

3000: $100.25 - Joe Otter: 99999

Bank Total Balance: $160.50

========== Close Account ==========

true

false

========== Account Info ==========

Account Info: Account Number: 2000

Checking account

Balance: $50.25

Customer: Alice Smith

123 University Center 93955

SSN: 8888

false

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

Write out the sum. (2k + 1) k=1

Answered: 1 week ago

Question

Discuss the ability of a corporation to raise capital.

Answered: 1 week ago

Question

Explain the tax attributes of an LLC.

Answered: 1 week ago