Here is the modified version for you:

#include <iostream>
#include <string>
#include <iomanip>
#include <stdio.h>
using namespace std;
class Howard_COP2513_F1601
{
public:
char userInput;
char userInput2;
string id;
string password;
string ID;
string PASSWORD;
double DEPOSIT;
double WITHDRAW;
double OLDBALANCE;
double NEWBALANCE;
Howard_COP2513_F1601()
{
userInput = ‘ ‘;
userInput2 = ‘ ‘;
id = “?”;
password = “?”;
ID = “?”;
PASSWORD = “?”;
DEPOSIT = 0.00;
WITHDRAW = 0.00;
OLDBALANCE = 0.00;
NEWBALANCE = 0.00;
}
void bankOption()
{
cout << “Please select an option: ” << endl;
cout << “l -> Login ” << endl;
cout << “c -> Create New Account ” << endl;
cout << “q -> Quit ” << endl;
cin >> userInput;
if (userInput == ‘l’ || userInput == ‘L’)
{
login();
}
else if (userInput == ‘c’ || userInput == ‘C’)
{
createAcnt();
}
else if (userInput == ‘q’ || userInput == ‘Q’)
{
quit();
}
}
void moneyOption()
{
cout << “d -> Deposit Money ” << endl;
cout << “w -> Withdraw Money ” << endl;
cout << “r -> Request Balance” << endl;
cout << “q -> Quit ” << endl;
cin >> userInput2;
if (userInput2 == ‘d’ || userInput2 == ‘D’)
{
dMoney();
}
else if (userInput2 == ‘w’ || userInput2 == ‘W’)
{
wMoney();
}
else if (userInput2 == ‘r’ || userInput2 == ‘R’)
{
rBalance();
}
else if (userInput2 == ‘q’ || userInput2 == ‘Q’)
{
quit();
}
fflush(stdin);
}
int login()
{
cout << “Please enter your user id: ” << endl;
cin >> id;
cout << “Please enter your password: ” << endl;
cin >> password;
if (id == ID && password == PASSWORD)
{
cout << “Access Granted – ” << ID << endl;
moneyOption();
}
else
{
cout << “******** ” << “LOGIN FAILED! ” << “********” << endl;
bankOption();
}
return 0;
}
int createAcnt()
{
cout << “Please enter your user name: ” << endl;
cin >> id;
cout << “Please enter your password: ” << endl;
cin >> password;
ID = id;
PASSWORD = password;
bankOption();
return 0;
}
int quit()
{
cout << “Thanks for banking with COP2513.F16,” << ID << “!” << endl;
system(“pause”);
return 0;
}
int dMoney()
{
cout << “Amount of deposit: ” << endl;
cin >> DEPOSIT;
OLDBALANCE = NEWBALANCE;
NEWBALANCE = OLDBALANCE + DEPOSIT;
moneyOption();
return 0;
}
int wMoney()
{
cout << “Amount of withdrawal: ” << endl;
cin >> WITHDRAW;
OLDBALANCE = NEWBALANCE;
NEWBALANCE = OLDBALANCE – WITHDRAW;
moneyOption();
return 0;
}
int rBalance()
{
cout << “Beginning balance: ” << “$ ” << fixed << setprecision(2) << OLDBALANCE << endl;
cout << “Deposit amount: ” << “$ ” << fixed << setprecision(2) << DEPOSIT << endl;
cout << “Withdrawal amount: ” << “$ ” << fixed << setprecision(2) << WITHDRAW << endl;
cout << “Your Balance is: ” << “$ ” << fixed << setprecision(2) << NEWBALANCE << endl;
cout << endl;
moneyOption();
return 0;
}
};
int main()
{
Howard_COP2513_F1601 obj1;
obj1.bankOption();
return 0;
}

 
******IN NEED OF THE ANSWER TO THE ABOVE QUESTION, KINDLY HIT ORDER NOW*******."

Leave a Reply

Your email address will not be published.