Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main (){
- char selection;
- float balance, withdraw, cwith, cdepo, deposit;
- system("clear");
- cout << "Automated Teller Machine \n";
- cout << "--------------------------- \n";
- cout << "[1] Balance Inquiry \n";
- cout << "[2] Withdraw \n";
- cout << "[3] Deposit \n";
- cout << "--------------------------- \n";
- cout << "Enter Selection : ";
- cin >> selection;
- cout << "--------------------------- \n";
- balance = 10000;
- system("clear");
- if (selection=='1') {
- cout << "Automated Teller Machine \n";
- cout << "--------------------------- \n";
- cout << "Balance Inquiry Module \n\n";
- cout << "Current Balance: " << balance << ".00" << "\n";
- cout << "--------------------------- \n";
- cout << "Request Processed! \n";
- cout << "--------------------------- \n";
- } else if (selection=='2') {
- cout << "Automated Teller Machine \n";
- cout << "--------------------------- \n";
- cout << "Withdraw Module \n\n";
- cout << "Withdraw Amount: ";
- cin >> withdraw;
- cwith = balance - withdraw;
- cout << "--------------------------- \n";
- cout << "Current Balance: " << cwith << ".00" << "\n";
- cout << "--------------------------- \n";
- } else if (selection=='3') {
- cout << "Automated Teller Machine \n";
- cout << "--------------------------- \n";
- cout << "Deposit Module \n\n";
- cout << "Deposit Amount: ";
- cin >> deposit;
- cdepo = balance + deposit;
- cout << "--------------------------- \n";
- cout << "Current Balance: " << cdepo << ".00" << "\n";
- cout << "--------------------------- \n";
- } else {
- cout << "Automated Teller Machine \n";
- cout << "--------------------------- \n\n";
- cout << "Transaction Terminated \n\n";
- cout << "--------------------------- \n";
- cout << "Account De-activated! \n";
- cout << "--------------------------- \n\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement