My C++ Bank Program - Fresh[Verde]
#include <iostream>
#include <string>
#include <Windows.h>
#include <Random>
using namespace std;
class Bank
{
public:
void CreateAccount()
{
system("cls");
Sleep(1000);
cout << "Enter An Account Id And You Will Be Ready To Go!" << endl;
cin >> AccountId;
Sleep(1000);
cout << "Your Login Will Be Your Id...Returing To Login..." << endl;
Sleep(2000);
system("cls");
Login();
}
void Login()
{
system("cls");
Sleep(1000);
cout << "Input Your Login:" << endl;
cin >> LoginId;
LoginReturn();
}
void BankMenu()
{
system("cls");
Sleep(1000);
cout << "Welcome User: " << AccountId << endl;
cout << endl;
do {
cout << "Balance(1)" << endl;
cout << endl;
cout << "Withdraw(2)" << endl;
cout << endl;
cout << "Deposit(3)" << endl;
cout << endl;
cout << "Exit(4)" << endl;
cout << endl;
cout << "Option:";
cin >> Banker;
BankReturn();
Sleep(5000);
system("cls");
} while (!exit);
}
void Balance()
{
system("cls");
Sleep(1000);
cout << "Your Balance Is:" << BalanceTotal;
Sleep(4000);
system("cls");
BankMenu();
}
void Withdraw()
{
system("cls");
Sleep(1000);
cout << "Your Balance Is:" << BalanceTotal << endl;
cout << "Withdraw Amount:" << endl;
cin >> WithdrawAccount;
cout << endl;
cout << "New Balance:" << BalanceTotal - WithdrawAccount << endl;
Sleep(5000);
system("cls");
BankMenu();
}
void Deposit()
{
system("cls");
Sleep(1000);
cout << "Your Balance Is:" << BalanceTotal << endl;
cout << "Deposit Amount:" << endl;
cin >> DepositAccount;
cout << endl;
cout << "New Balance:" << BalanceTotal + DepositAccount;
Sleep(5000);
system("cls");
BankMenu();
}
void LoginReturn()
{
if (LoginId == AccountId)
{
system("cls");
Sleep(1000);
cout << endl;
cout << "You Have Logged In You Will Now Be Returned To The Main Bank Menu." << endl;
Sleep(2000);
system("cls");
BankMenu();
}
else
{
system("cls");
Sleep(1000);
cout << endl;
cout << "Incorrect!" << endl;
Sleep(2000);
system("cls");
ExitProcess(0);
}
}
void BankReturn()
{
if (Banker == balance)
{
Balance();
}
else if (Banker == deposit)
{
Deposit();
}
else if (Banker == withdraw)
{
Withdraw();
}
else if (Banker == exit)
{
system("cls");
Sleep(1000);
cout << "Ending Process..." << endl;
Sleep(3000);
system("cls");
ExitProcess(0);
}
else if (Banker != withdraw || Banker != deposit || Banker != balance)
{
system("cls");
Sleep(1000);
cout << "Unrecognized Input!" << endl;
Sleep(2000);
system("cls");
ExitProcess(0);
}
}
private:
int AccountId;
char Banker;
int LoginId;
int BalanceTotal = 0;
int DepositAccount;
int WithdrawAccount;
//Should Probably Use An Array Below
char balance = '1';
char exit = '4';
char withdraw = '2';
char deposit = '3';
};
class Person
{
public:
void Start()
{
system("cls");
Sleep(1000);
cout << "To Create An Account Input N, To Exit Input Y..." << endl;
cin >> NewAccount;
switch (NewAccount)
{
case 'N':
cout << "Sending You To Account Creation...." << endl;
Sleep(3000);
bank.CreateAccount();
case 'Y':
system("cls");
Sleep(1000);
cout << "Exitting The Process..." << endl;
Sleep(3000);
system("cls");
ExitProcess(0);
}
}
private:
char NewAccount;
Bank bank;
};
int main()
{
Bank bank;
Person person;
SetConsoleTitle(L"Bank Program - By Verde");
HANDLE Colour = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(Colour, FOREGROUND_RED);
person.Start();
}
#include <string>
#include <Windows.h>
#include <Random>
using namespace std;
class Bank
{
public:
void CreateAccount()
{
system("cls");
Sleep(1000);
cout << "Enter An Account Id And You Will Be Ready To Go!" << endl;
cin >> AccountId;
Sleep(1000);
cout << "Your Login Will Be Your Id...Returing To Login..." << endl;
Sleep(2000);
system("cls");
Login();
}
void Login()
{
system("cls");
Sleep(1000);
cout << "Input Your Login:" << endl;
cin >> LoginId;
LoginReturn();
}
void BankMenu()
{
system("cls");
Sleep(1000);
cout << "Welcome User: " << AccountId << endl;
cout << endl;
do {
cout << "Balance(1)" << endl;
cout << endl;
cout << "Withdraw(2)" << endl;
cout << endl;
cout << "Deposit(3)" << endl;
cout << endl;
cout << "Exit(4)" << endl;
cout << endl;
cout << "Option:";
cin >> Banker;
BankReturn();
Sleep(5000);
system("cls");
} while (!exit);
}
void Balance()
{
system("cls");
Sleep(1000);
cout << "Your Balance Is:" << BalanceTotal;
Sleep(4000);
system("cls");
BankMenu();
}
void Withdraw()
{
system("cls");
Sleep(1000);
cout << "Your Balance Is:" << BalanceTotal << endl;
cout << "Withdraw Amount:" << endl;
cin >> WithdrawAccount;
cout << endl;
cout << "New Balance:" << BalanceTotal - WithdrawAccount << endl;
Sleep(5000);
system("cls");
BankMenu();
}
void Deposit()
{
system("cls");
Sleep(1000);
cout << "Your Balance Is:" << BalanceTotal << endl;
cout << "Deposit Amount:" << endl;
cin >> DepositAccount;
cout << endl;
cout << "New Balance:" << BalanceTotal + DepositAccount;
Sleep(5000);
system("cls");
BankMenu();
}
void LoginReturn()
{
if (LoginId == AccountId)
{
system("cls");
Sleep(1000);
cout << endl;
cout << "You Have Logged In You Will Now Be Returned To The Main Bank Menu." << endl;
Sleep(2000);
system("cls");
BankMenu();
}
else
{
system("cls");
Sleep(1000);
cout << endl;
cout << "Incorrect!" << endl;
Sleep(2000);
system("cls");
ExitProcess(0);
}
}
void BankReturn()
{
if (Banker == balance)
{
Balance();
}
else if (Banker == deposit)
{
Deposit();
}
else if (Banker == withdraw)
{
Withdraw();
}
else if (Banker == exit)
{
system("cls");
Sleep(1000);
cout << "Ending Process..." << endl;
Sleep(3000);
system("cls");
ExitProcess(0);
}
else if (Banker != withdraw || Banker != deposit || Banker != balance)
{
system("cls");
Sleep(1000);
cout << "Unrecognized Input!" << endl;
Sleep(2000);
system("cls");
ExitProcess(0);
}
}
private:
int AccountId;
char Banker;
int LoginId;
int BalanceTotal = 0;
int DepositAccount;
int WithdrawAccount;
//Should Probably Use An Array Below
char balance = '1';
char exit = '4';
char withdraw = '2';
char deposit = '3';
};
class Person
{
public:
void Start()
{
system("cls");
Sleep(1000);
cout << "To Create An Account Input N, To Exit Input Y..." << endl;
cin >> NewAccount;
switch (NewAccount)
{
case 'N':
cout << "Sending You To Account Creation...." << endl;
Sleep(3000);
bank.CreateAccount();
case 'Y':
system("cls");
Sleep(1000);
cout << "Exitting The Process..." << endl;
Sleep(3000);
system("cls");
ExitProcess(0);
}
}
private:
char NewAccount;
Bank bank;
};
int main()
{
Bank bank;
Person person;
SetConsoleTitle(L"Bank Program - By Verde");
HANDLE Colour = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(Colour, FOREGROUND_RED);
person.Start();
}