Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main (){
- char selection, response = 'Y';
- float balance = 10500.00, withdraw, deposit;
- while (response=='y' || response=='Y') {
- system("cls");
- cout << "Automated Teller Machine \n";
- cout << "--------------------------- \n";
- cout << "[B]alance Inquiry \n";
- cout << "[W]ithdraw \n";
- cout << "[D]eposit \n";
- cout << "--------------------------- \n";
- cout << "Enter Selection : ";
- cin >> selection;
- system("cls");
- if (selection=='B' || selection == 'b') {
- 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";
- cout << "Transact Again? [Y/N]: ";
- cin >> response;
- cout << "--------------------------- \n";
- } else if (selection=='W' || selection == 'w') {
- cout << "Automated Teller Machine \n";
- cout << "--------------------------- \n";
- cout << "Withdraw Module \n\n";
- cout << "Withdraw Amount: ";
- cin >> withdraw;
- balance = balance - withdraw;
- cout << "--------------------------- \n";
- cout << "Current Balance: " << balance << ".00" << "\n";
- cout << "--------------------------- \n";
- cout << "Transact Again? [Y/N]: ";
- cin >> response;
- cout << "--------------------------- \n";
- } else if (selection=='D' || selection == 'd') {
- cout << "Automated Teller Machine \n";
- cout << "--------------------------- \n";
- cout << "Deposit Module \n\n";
- cout << "Deposit Amount: ";
- cin >> deposit;
- balance = balance + deposit;
- cout << "--------------------------- \n";
- cout << "Current Balance: " << balance << ".00" << "\n";
- cout << "--------------------------- \n";
- cout << "Transact Again? [Y/N]: ";
- cin >> response;
- 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";
- cout << "Transact Again? [Y/N]: ";
- cin >> response;
- } }
- system("cls");
- cout << "Automated Teller Machine \n";
- cout << "--------------------------- \n\n";
- cout << "Transaction Terminated! \n\n";
- cout << "--------------------------- \n";
- cout << "Process Ended... \n";
- cout << "--------------------------- \n\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement