Question: in c++ STEP1: Define a member function withdraw() that withdraws money from account Ensure the withdrawal amount does not exceed the Accounts balance. If it
in c++
STEP1:
Define a member function withdraw() that withdraws money from account
Ensure the withdrawal amount does not exceed the Accounts balance.
If it does, the balance remains unchanged but a message is displayed:
Withdrawal amount exceeded account balance
STEP 2:
Create a file utility_functions.cpp
Include Account.h
Define a template function:
template
int searchAndDeposit(array
It searches name parameter in the accounts array and if it finds it deposits the amount into that persons account and returns 1
Otherwise, it returns -1
STEP 3:
Step3:
in utility_functions.cpp
Define a template function:
template
int searchAndWithdraw(array
It searches name parameter in the accounts array and if it finds it withdraws amount from that persons account and returns 1
Otherwise, it returns -1
SAMPLE OUTPUT:
Accounts:
Jhon Araf
Balance: $300
Jade Milan
Balance: $0
Joe Kafa
Balance: $100
Depositing $240 into Jade Milan's account.
Withdrawing $150 from Jhon Araf's account.
Accounts:
Jhon Araf
Balance: $150
Jade Milan
Balance: $240
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
