backup
backup
h>
#include<conio.h>
int main() {
int balance = 10000;
int pin, option;
int withdrawAmount, depositAmount;
clrscr();
gotoxy(30,1);
cout << "Welcome to the ATM!" ;
gotoxy(10,5);
cout << "Enter your PIN: ";
gotoxy(10,9);
cout << "Remarks--";
gotoxy(32,9);
cin >> pin;
clrscr();
// Main menu
if (pin == 123456) { /
do {
gotoxy(30,1);
cout << "\nATM Menu:";
gotoxy(5,3);
cout << "1. Check Balance";
gotoxy(5,4);
cout << "2. Withdraw";
gotoxy(5,5);
cout << "3. Deposit";
gotoxy(5,6);
cout << "4. Exit";
gotoxy(5,7);
cout << "Choose an option: ";
cin >> option;
switch (option) {
case 1: // Check Balance
cout << "Your balance is $" << balance;
break;
case 2: // Withdraw
cout << "Enter the amount to withdraw: ";
cin >> withdrawAmount;
if (withdrawAmount <= balance) {
balance -= withdrawAmount;
cout << "Withdrawal successful. Remaining balance: $" << balance;
} else {
cout << "Insufficient funds!" ;
}
break;
case 3: // Deposit
cout << "Enter the amount to deposit: ";
cin >> depositAmount;
balance += depositAmount;
cout << "Deposit successful. New balance: $" << balance;
break;
case 4: // Exit
cout << "Thank you for using the ATM. Goodbye!";
break;
default:
cout << "Invalid option. Please try again.";
break;
}
} while (option != 4);
} else {
cout << "Incorrect PIN. Access denied.";
}
return 0;
}