Advertisement
Rainrix2001

Prob1

Aug 22nd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.89 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main (){
  5.     char selection;
  6.     float balance, withdraw, cwith, cdepo, deposit;
  7.     system("clear");
  8.     cout << "Automated Teller Machine \n";
  9.     cout << "--------------------------- \n";
  10.     cout << "[1] Balance Inquiry \n";
  11.     cout << "[2] Withdraw \n";
  12.     cout << "[3] Deposit \n";
  13.     cout << "--------------------------- \n";
  14.     cout << "Enter Selection : ";
  15.     cin >> selection;
  16.     cout << "--------------------------- \n";
  17.     balance = 10000;
  18.     system("clear");
  19.  
  20.     if (selection=='1') {
  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.  
  30.     } else if (selection=='2') {
  31.        
  32.        
  33.         cout << "Automated Teller Machine \n";
  34.         cout << "--------------------------- \n";
  35.         cout << "Withdraw Module \n\n";
  36.         cout << "Withdraw Amount: ";
  37.         cin >> withdraw;
  38.         cwith = balance - withdraw;
  39.         cout << "--------------------------- \n";
  40.         cout << "Current Balance: " << cwith << ".00" << "\n";
  41.         cout << "--------------------------- \n";
  42.  
  43.     } else if (selection=='3') {
  44.        
  45.        
  46.         cout << "Automated Teller Machine \n";
  47.         cout << "--------------------------- \n";
  48.         cout << "Deposit Module \n\n";
  49.         cout << "Deposit Amount: ";
  50.         cin >> deposit;
  51.         cdepo = balance + deposit;
  52.         cout << "--------------------------- \n";
  53.         cout << "Current Balance: " << cdepo << ".00" << "\n";
  54.         cout << "--------------------------- \n";
  55.  
  56.     } else {
  57.        
  58.         cout << "Automated Teller Machine \n";
  59.         cout << "--------------------------- \n\n";
  60.         cout << "Transaction Terminated \n\n";
  61.         cout << "--------------------------- \n";
  62.         cout << "Account De-activated! \n";
  63.         cout << "--------------------------- \n\n";
  64.     }
  65.     return 0;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement