Advertisement
Rainrix2001

Prob5 Unfinished

Aug 22nd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.58 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main (){
  5.     char selection, response = 'Y';
  6.     float balance = 10500.00, withdraw, deposit;
  7.  
  8.     while (response=='y' || response=='Y') {
  9.     system("cls");
  10.     cout << "Automated Teller Machine \n";
  11.     cout << "--------------------------- \n";
  12.     cout << "[B]alance Inquiry \n";
  13.     cout << "[W]ithdraw \n";
  14.     cout << "[D]eposit \n";
  15.     cout << "--------------------------- \n";
  16.     cout << "Enter Selection : ";
  17.     cin >> selection;
  18.     system("cls");
  19.    
  20.     if (selection=='B' || selection == 'b') {
  21.        
  22.         cout << "Automated Teller Machine \n";
  23.         cout << "--------------------------- \n";
  24.         cout << "Balance Inquiry Module \n\n";
  25.         cout << "Current Balance: " << balance << ".00" << "\n";
  26.         cout << "--------------------------- \n";
  27.         cout << "Request Processed! \n";
  28.         cout << "--------------------------- \n";
  29.         cout << "Transact Again? [Y/N]: ";
  30.         cin >> response;
  31.         cout << "--------------------------- \n";
  32.  
  33.      } else if (selection=='W' || selection == 'w') {
  34.        
  35.        
  36.         cout << "Automated Teller Machine \n";
  37.         cout << "--------------------------- \n";
  38.         cout << "Withdraw Module \n\n";
  39.         cout << "Withdraw Amount: ";
  40.         cin >> withdraw;
  41.         balance = balance - withdraw;
  42.         cout << "--------------------------- \n";
  43.         cout << "Current Balance: " << balance << ".00" << "\n";
  44.         cout << "--------------------------- \n";
  45.         cout << "Transact Again? [Y/N]: ";
  46.         cin >> response;
  47.         cout << "--------------------------- \n";
  48.  
  49.      } else if (selection=='D' || selection == 'd') {
  50.        
  51.        
  52.         cout << "Automated Teller Machine \n";
  53.         cout << "--------------------------- \n";
  54.         cout << "Deposit Module \n\n";
  55.         cout << "Deposit Amount: ";
  56.         cin >> deposit;
  57.         balance = balance + deposit;
  58.         cout << "--------------------------- \n";
  59.         cout << "Current Balance: " << balance << ".00" << "\n";
  60.         cout << "--------------------------- \n";
  61.         cout << "Transact Again? [Y/N]: ";
  62.         cin >> response;
  63.         cout << "--------------------------- \n";
  64.  
  65.     } else {
  66.        
  67.         cout << "Automated Teller Machine \n";
  68.         cout << "--------------------------- \n\n";
  69.         cout << "Transaction Terminated \n\n";
  70.         cout << "--------------------------- \n";
  71.         cout << "Account De-activated! \n";
  72.         cout << "--------------------------- \n\n";
  73.         cout << "Transact Again? [Y/N]: ";
  74.         cin >> response;
  75.     } }
  76.  
  77.      system("cls");
  78.         cout << "Automated Teller Machine \n";
  79.         cout << "--------------------------- \n\n";
  80.         cout << "Transaction Terminated! \n\n";
  81.         cout << "--------------------------- \n";
  82.         cout << "Process Ended... \n";
  83.         cout << "--------------------------- \n\n";
  84.    
  85.     return 0;
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement