Embed presentation
Downloaded 59 times
![# include<constream.h>
int main()
{
clrscr();
int password;
for (int i=0;i<3;i++)
{cout<<"enter password:n";
cin>>password;
if (password==12345)
{cout<<"correct!n";
double balance=10000;
double withdraw,deposit;
int option;
cout<<"n";
cout<< " *************Aqib memon****************n";
cout<<"********Automated teller machine********"<<endl;
cout<<"choose a transaction n";
cout<<"n";
cout<<"[1] inquire balance n"
<<"[2] withdraw n"
<<"[3] deposite n"
<<"[4] Quit n"
<<"n"
<<"Enter option:";
cin>>option;
switch(option)
{
case 1:
cout<<"n [[[BALANCE INQUIRY]]]n";
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"n your current balance is Rs:"<<balance<<endl;
break;
case 2:
cout<<"n [[[WITHDRAW]]]n";
cout<<"n Enter ammount Rs:";
cin>>withdraw;
balance=balance-withdraw;
cout.setf(ios::fixed);](https://image.slidesharecdn.com/atmmachine-110921034752-phpapp01/75/Atm-machine-using-c-1-2048.jpg)
![cout.setf(ios::showpoint);
cout.precision(2);
cout<<"you withdrew Rs:"<<withdraw<<endl;
cout<<"your remainig balance is"<<balance<<endl;
continue;
case 3:
cout<<"n [[[deposit]]]n";
cout<<"Enter ammount Rs:";
cin>>deposit;
balance=balance+deposit;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"You deposited Rs:"<<deposit<<endl;
cout<<"Your new balance is"<<balance<<endl;
continue;
case 4:
cout<<"n***[[[EXIT MODE]]]***n";
break;
default :
cout<<"n That is an invalid optionn";
}
break;
}
else
cout<<"n please try again n";
}
getch();
return 0;
}](https://image.slidesharecdn.com/atmmachine-110921034752-phpapp01/85/Atm-machine-using-c-2-320.jpg)

This C++ program simulates an automated teller machine (ATM). It prompts the user to enter a password, and if correct, displays a menu with options to inquire balance, withdraw money, deposit money, or quit. Based on the selected option, it will output the current balance, process withdrawals or deposits by updating the balance variable, and terminate or return to the main menu.
![# include<constream.h>
int main()
{
clrscr();
int password;
for (int i=0;i<3;i++)
{cout<<"enter password:n";
cin>>password;
if (password==12345)
{cout<<"correct!n";
double balance=10000;
double withdraw,deposit;
int option;
cout<<"n";
cout<< " *************Aqib memon****************n";
cout<<"********Automated teller machine********"<<endl;
cout<<"choose a transaction n";
cout<<"n";
cout<<"[1] inquire balance n"
<<"[2] withdraw n"
<<"[3] deposite n"
<<"[4] Quit n"
<<"n"
<<"Enter option:";
cin>>option;
switch(option)
{
case 1:
cout<<"n [[[BALANCE INQUIRY]]]n";
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"n your current balance is Rs:"<<balance<<endl;
break;
case 2:
cout<<"n [[[WITHDRAW]]]n";
cout<<"n Enter ammount Rs:";
cin>>withdraw;
balance=balance-withdraw;
cout.setf(ios::fixed);](https://image.slidesharecdn.com/atmmachine-110921034752-phpapp01/75/Atm-machine-using-c-1-2048.jpg)
![cout.setf(ios::showpoint);
cout.precision(2);
cout<<"you withdrew Rs:"<<withdraw<<endl;
cout<<"your remainig balance is"<<balance<<endl;
continue;
case 3:
cout<<"n [[[deposit]]]n";
cout<<"Enter ammount Rs:";
cin>>deposit;
balance=balance+deposit;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"You deposited Rs:"<<deposit<<endl;
cout<<"Your new balance is"<<balance<<endl;
continue;
case 4:
cout<<"n***[[[EXIT MODE]]]***n";
break;
default :
cout<<"n That is an invalid optionn";
}
break;
}
else
cout<<"n please try again n";
}
getch();
return 0;
}](https://image.slidesharecdn.com/atmmachine-110921034752-phpapp01/85/Atm-machine-using-c-2-320.jpg)