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 > choice; cin.get(discard); cout > acctNumber; cout > choice; cin.get(discard); cout
void menu() { cout
void subMenu() { cout
int search(bankAccount list[], int length, int acctNum) { for (int i = 0; i
void addCustomer(bankAccount list[], int& length) { string name; string acctType; double deposit; double interestRate; if (length > acctType; cout > deposit; cout > interestRate; 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 > amount; cout > amount; cout > selection; cout
void printCustomersData(bankAccount list[], int length) { for (int i = 0; i bankAccount #include #include using namespace std; class bankAccount { public: void setdata(string name, string accType, double bal, double intRate); void deposit(double ant); void withdraw(double amt); double getInterest(); void updateBalance(); void print() const; int getAccount Number() const; string getAccountHolderName() const; string getAccountType() const; double getBalance() const; double getInterestRate() const; bankAccount(string name - ", string acc Type - double bal - 0.0, double intRate = 0.0); private: static int num; string accountHolderName; string accountType; int account Number; double balance; double interestRate; }; Page 1 bankAccount Imp #include #include "bankAccount.h" #include using namespace std; int bankAccount:: num = 100; void bankAccount::setdata(string name, string accType, double bal, double intRate) { accountHolderName = name; accountType accType; ; account Number = num; num = num + 100; balance = bal; interestRate - intRate / 100; } void bankAccount::deposit(double amt) { balance = balance + amt; } void bankAccount::updateBalance() { balance = balance + balance interestRate; } double bankAccount::getInterest() { return balance * interestRate; } void bankAccount::withdraw(double amt) { cout #include #include "bankAccount.h" using namespace std; void menu(); void subMenu(); int search(bankAccount list[], int length, int acct Num); 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 > choice; cin.get(discard); cout > acctNumber; cout > choice; cin.get(discard); cout > acct Type; cout > deposit; cout > interestRate; cout > selection; cout > amount; cout > amount; cout > selection; cout #include using namespace std; class bankAccount { public: void setdata(string name, string accType, double bal, double intRate); void deposit(double ant); void withdraw(double amt); double getInterest(); void updateBalance(); void print() const; int getAccount Number() const; string getAccountHolderName() const; string getAccountType() const; double getBalance() const; double getInterestRate() const; bankAccount(string name - ", string acc Type - double bal - 0.0, double intRate = 0.0); private: static int num; string accountHolderName; string accountType; int account Number; double balance; double interestRate; }; Page 1 bankAccount Imp #include #include "bankAccount.h" #include using namespace std; int bankAccount:: num = 100; void bankAccount::setdata(string name, string accType, double bal, double intRate) { accountHolderName = name; accountType accType; ; account Number = num; num = num + 100; balance = bal; interestRate - intRate / 100; } void bankAccount::deposit(double amt) { balance = balance + amt; } void bankAccount::updateBalance() { balance = balance + balance interestRate; } double bankAccount::getInterest() { return balance * interestRate; } void bankAccount::withdraw(double amt) { cout #include #include "bankAccount.h" using namespace std; void menu(); void subMenu(); int search(bankAccount list[], int length, int acct Num); 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 > choice; cin.get(discard); cout > acctNumber; cout > choice; cin.get(discard); cout > acct Type; cout > deposit; cout > interestRate; cout > selection; cout > amount; cout > amount; cout > selection; cout