ATM Interface
ATM Interface
#include <iostream>
//Login system
bool login() {
int pinnumber;
int attempts = 0;
while(attempts < 3) {
if(pinnumber == pin) {
return true;
else {
attempts++;
cout<<"Account locked!";
return false;
//checking balance
void checkbalance() {
//Withdraw Function
void withdraw() {
float amount;
cin>>amount;
else {
cout << "Withdrawal successful. Remaining balance: Rs." << balance << endl;
//Deposit Function
void deposit() {
float amount;
cin>>amount;
void changePIN() {
int newpin;
cin>>newpin;
pin = newpin;
}
void Menu() {
int choice;
do {
cout<<"1.Check Balance\n";
cout<<"2.Withdraw Money\n";
cout<<"3.Deposit Money\n";
cout<<"4.Change PIN\n";
cout<<"5.Exit\n";
cin>>choice;
switch (choice) {
case 1:
checkbalance();
break;
case 2:
withdraw();
break;
case 3:
deposit();
break;
case 4:
changePIN();
break;
case 5:
cout<<"Exit";
break;
default:
cout<<"Choice Invalid";
}
while(choice != 5);
int main() {
if(login()) {
Menu();
return 0;