You will create a program that manages accounts in a bank. This program will contain two classes, Account and Customer, as well as the driver class. You will create a customer record within the driver and then create new accounts for the customer, deposit, withdraw, transfer funds, and consolidate accounts. Display messages within each method that tells the user what transaction has occurred. See sample run.
Validation: Be sure to validate the customer's social security number. In addition, if a user enters a string instead of a character, such as 'open instead of o, your program should be able to accept it without an error, as well as handle different upper and lower case. It also needs to handle any invalid entries that might be entered with any of the user inputs.
Instance variables:
Methods:
Instance variables:
Methods:
Below is a sample run of Program 4. Items in green are user input
Enter the customer name:
Suzie Woozie
Enter the customer social security number:
12-345-6789
Not in the correct format. Try again.
Enter the customer social security number:
123456789
Not enough characters. Please re-enter!
Enter the customer social security number:
123-45-6789
Creating a new customer
Customer :Suzie Woozie
Social Security Number: xxx-xx-6789
Total Accounts: 0
Choose an option:
O: Create or open an account
D: Deposit to account
W: Withdraw from account
T: Transfer funds
C: Consolidate accounts
X: Close account
Q: Quit
o
How much do you want to deposit into your new account?
1000
Creating an account
Account Number: 89300
Balance: $1000.0
Customer :Suzie Woozie
Social Security Number: xxx-xx-6789
Total Accounts: 1
Choose an option:
O: Create or open an account
D: Deposit to account
W: Withdraw from account
T: Transfer funds
C: Consolidate accounts
X: Close account
Q: Quit
o
How much do you want to deposit into your new account?
500
Creating an account
Account Number: 21512
Balance: $500.0
Customer :Suzie Woozie
Social Security Number: xxx-xx-6789
Total Accounts: 2
Choose an option:
O: Create or open an account
D: Deposit to account
W: Withdraw from account
T: Transfer funds
C: Consolidate accounts
X: Close account
Q: Quit
d
How much do you want to deposit into account 1?
100
Account Number: 89300
Balance: $1000.0
Depositing funds
Account Number: 89300
Balance: $1100.0
How much do you want to deposit into account 2?
0
No funds deposited
Account Number: 21512
Balance: $500.0
Choose an option:
O: Create or open an account
D: Deposit to account
W: Withdraw from account
T: Transfer funds
C: Consolidate accounts
X: Close account
Q: Quit
w
How much do you want to withdraw from account 1?
1200
Insufficient funds!
Account Number: 89300
Balance: $1100.0
How much do you want to withdraw from account 2?
300
Withdrawing funds!
Account Number: 21512
Balance: $200.0
Choose an option:
O: Create or open an account
D: Deposit to account
W: Withdraw from account
T: Transfer funds
C: Consolidate accounts
X: Close account
Q: Quit
t
How much money do you want to transfer?
1500
You have two accounts: 1-89300 and 2-21512
Which account are funds being withdrawn from?
1
Insufficient funds to make that transfer!
Account Number: 89300
Balance: $1100.0
Account Number: 21512
Balance: $200.0
Choose an option:
O: Create or open an account
D: Deposit to account
W: Withdraw from account
T: Transfer funds
C: Consolidate accounts
X: Close account
Q: Quit
t
How much money do you want to transfer?
500
You have two accounts: 1-89300 and 2-21512
Which account are funds being withdrawn from?
1
Transferring funds!
Account Number: 89300
Balance: $600.0
Account Number: 21512
Balance: $700.0
Choose an option:
O: Create or open an account
D: Deposit to account
W: Withdraw from account
T: Transfer funds
C: Consolidate accounts
X: Close account
Q: Quit
c
Creating an account
Consolidating accounts!
Account Number: 81201
Balance: $1300.0
Closing account
Closing account
Choose an option:
O: Create or open an account
D: Deposit to account
W: Withdraw from account
T: Transfer funds
C: Consolidate accounts
X: Close account
Q: Quit
x
Closing account
Choose an option:
O: Create or open an account
D: Deposit to account
W: Withdraw from account
T: Transfer funds
C: Consolidate accounts
X: Close account
Q: Quit
q
Customer has 0 accounts
Bank has 0 accounts.