Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started