Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a banking program in c + + that simulates the operation of your local bank. You should declare the following collection of classes. Class

Write a banking program in c++ that simulates the operation of your local bank. You should declare the following collection of classes.
Class Account
Data fields: customer (type Customer), balance, account_number, transactions array (type transaction*)
Member functions: create_Account()1, get_account_number(), get_balance(), get_customer(), to_string(), set_customer(), set_balance()
Class Savings_Account extends Account
Member functions: deposit(), withdraw(), add_interest()
Class Checking_Account extends Account
Member functions: deposit(), withdraw(), add_interest()
Class Customer
Data fields: name, address, age, telephone_number, customer_number
Member functions: Accessors and modifiers for data fields
Classes Senior, Adult, Student, all of which extend class Customer
Each has constant data fields, SAVINGS_INTEREST, CHECK_INTEREST, CHECK_CHARGE, and OVERDRAFT_PENALTY, that define these values for customers of that type.
Class Bank
Data field: array accounts (type Account*)
Member functions: add_account(), make_deposit(), make_withdrawal(), get_account(),
Class Transaction
Data fields: transaction_type, amount, balance, type Date2
Member functions: to_string()
You need to write all these classes and an application class that interacts with the user. In the application, you should first open several accounts and then enter several transactions. A sample console output is attached.
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>0
Enter Customer Name> John
Enter Customer Address> Regina
Enter Customer Age>40
Enter Customer Phone Number>30633333
Select:
0: Senior
1: Adult
2: Student
>1
Select:
0: Checking
1: Savings
>1
Account: 0 Added
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>1
Enter Account Number>0
Enter The Amount>2000
Enter the date yyyy-mm-dd>2018-10-10
Deposit in 0 amount: $2000.00 on 2018-10-10 new balance: $2000.00
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>3
Enter Account Number>0
Account: 0
Owner: John
Type of customer: Adult
Balance: $2000
DEP 2018-10-10 $ 2000.00 $ 2000.00
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>2
Enter Account Number>0
Enter The Amount>100
Enter the date yyyy-mm-dd>2020-10-10
Withdraw from 0 amount: 100.00 on 2020-10-10 new balance: 2020.16
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>3
Enter Account Number>0
Account: 0
Owner: John
Type of customer: Adult
Balance: $2020.16
DEP 2018-10-10 $ 2000.00 $ 2000.00
INT CR 2020-10-10 $ 120.16 $ 2120.16
WD 2020-10-10 $ 100.00 $ 2020.16
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>0
Enter Customer Name> Sara
Enter Customer Address> Regina ave
Enter Customer Age>18
Enter Customer Phone Number>30644444
Select:
0: Senior
1: Adult
2: Student
>2
Select:
0: Checking
1: Savings
>0
Account: 1 Added
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>1
Enter Account Number>1
Enter The Amount>500
Enter the date yyyy-mm-dd>2018-10-11
Deposit in 1 amount: $500.00 on 2018-10-11 new balance: $500.00
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>3
Enter Account Number>1
Account: 1
Owner: Sara
Type of customer: Student
Balance: $500
DEP 2018-10-11 $ 500.00 $ 500.00
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>2
Enter Account Number>1
Enter The Amount>100
Enter the date yyyy-mm-dd>2020-10-10
Withdraw from 1 amount: 100.00 on 2020-10-10 new balance: 409.98
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>3
Enter Account Number>1
Account: 1
Owner: Sara
Type of customer: Student
Balance: $409.98
DEP 2018-10-11 $ 500.00 $ 500.00
INT CR 2020-10-10 $ 10.00 $ 510.00
WD 2020-10-10 $ 100.00 $ 410.00
CHKCHG 2020-10-10 $ 0.02 $ 409.98
Select:
0: Add Account
1: Make Deposit
2: Make Withdrawal
3: Check Account
4: Exit
>
if possible pls provide me a single program with everything and also consider below
const double Student::SAVINGS_INTEREST =0.04; // annual rate
const double Student::CHECKING_INTEREST =0.01; // annual rate. Yes! this is interest rate for the checking account.
const double Student::CHECK_CHARGE =0.02; //cents for withdrawal
const double Student::OVERDRAFT_PENALTY =25.0; //dollar
---------------------------------------------------------------------------
const double Senior::SAVINGS_INTEREST =0.04; // annual rate
const double Senior::CHECKING_INTEREST =0.01; // annual rate. Yes! this is interest rate for the checking account.
const double Senior::CHECK_CHARGE

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

Students also viewed these Databases questions

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago