Question: Use the C++ code below to build an atm management system. The user should also have the option to change their pin. All these records
NOTE: Create your own txt file with data that your system will source information from and update as need be.
#include
#include
using namespace std;
double yourBalance = 0.0;
char differentTransaction;
double withdrawAmount;
double depositAmount;
int yourChoices;
void theTransactions()
{
cout
cout
cout
cout
cout
cout
cout
cout \";
cin >> yourChoices;
switch(yourChoices)
{
case 1: // Balance
cout
cout \">
cout
cout \";
cin >> differentTransaction;
if(differentTransaction == 'Y' ||differentTransaction == 'y' )
theTransactions();
else
cout \">
break;
case 2: // Deposit choice
cout
cout
cin >> depositAmount;
yourBalance += depositAmount;
cout.setf(ios::fixed|ios::showpoint);
cout
cout
cout
cout \";
cin >> differentTransaction;
if (differentTransaction == 'Y'||differentTransaction == 'y' )
{
theTransactions();
}
else
cout \">
break;
case 3: // Withdarw choice
cout
cout
cin >> withdrawAmount;
if (withdrawAmount > yourBalance)
{
cout
cout
cout
cout \";
cin >> differentTransaction;
if (differentTransaction == 'Y'||differentTransaction == 'y' )
{
theTransactions();
}
}
else
{
yourBalance -= withdrawAmount;
cout.setf(ios::fixed|ios::showpoint);
cout
cout
cout
cout
cout
cout \";
cin >> differentTransaction;
if(differentTransaction == 'Y'||differentTransaction == 'y' )
theTransactions();
else
cout \">
} break;
}
}
int main()
{
theTransactions();
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
