Question
C++ Instructions Open the bank account pdf file on the homepage of this course (The following pictures are from the bank account pdf). Type the
C++
Instructions | |
Open the bank account pdf file on the homepage of this course (The following pictures are from the bank account pdf). Type the contents into notepad. Compile the implementation file. Compile the program. Please pay attention to what is happening in each section as you create the code. Create the files from the pdf. You are only copying the code, but attempting to pay attention to the task at hand to help in your understanding of classes. |
//Main program
#include
#include
#include "bankAccount.h"
using namespace std;
void menu();
void subMenu();
int search(bankAccount list[], int length, int acctNum)
void addCustomer(bankAccount list[], int& length);
void processCustomer(bankAccount list[], int length, int acctNum);
void printCustomersData(bankAccount list[], int length);
int main()
{
bankAccount customersList[10];
int choice;
int numOfCustomer = 0;
int acctNumber;
char discard;
cout
menu();
cin >> choice;
cin.get(discard);
cout
while (choice != 9)
{
switch(choice)
{
case 1:
if (numOfCustomer
addCustomer(customersList, numOfCustomer);
else
cout
break;
case 2:
cout
cin >> acctNumber;
cout
processCustomer(customersList, numOfCustomer, acctNumber);
break;
case 3:
printCustomersData(customersList, numOfCustomer);
break;
default:
cout
}
menu();
cin >> choice;
cin.get(discard);
cout
}
return 0;
}
void menu()
{
cout
cout
cout
cout
}
void subMenu()
{
cout
cout
cout
cout
}
int search(bankAccount list[], int length, int acctNum)
{
for (int i = 0; i
if (list[i].getAccountNumber() == acctNum)
return 1;
return -1;
}
void addCustomer(bankAccount list[], int& length)
{
string name;
string acctType;
double deposit;
double interestRate;
if (length
{
cout
getline(cin, name);
cout
cout
cin >> acctType;
cout
cout
cin >> deposit;
cout
cout
cin >> interestRate;
cout
list[length++].setdata(name, acctType, deposit, interestRate);
}
else
cout
}
void processorCustomer(bankAccount list[], int length, int acctNum)
{
int index;
double amount;
index = search(list, length, acctNum);
if (index != -1)
{
subMenu();
int selection;
cin >> selection;
cout
while (selection != 9)
{
switch (selection)
{
case 1:
cout
cin >> amount;
cout
list[index].deposit(amount);
break;
case 2:
cout
cin >> amount;
cout
list[index].withdraw(amount);
break;
case 3:
list[index].print();
break;
default:
cout
}
subMenu();
cin >> selection;
cout
}
}
else
cout
}
void printCustomersData(bankAccount list[], int length)
{
for (int i = 0; i
{
list[i].print();
cout
}
}
bankAccount #includeStep 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