Embed presentation
Download to read offline
![# 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;](https://image.slidesharecdn.com/atmmachine-110921034318-phpapp01/75/Atm-machine-using-c-1-2048.jpg)
![cout.setf(ios::fixed);
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-110921034318-phpapp01/85/Atm-machine-using-c-2-320.jpg)

The document contains code for an automated teller machine (ATM) program. The program prompts the user to enter a password, and if correct, displays a menu to make transactions including: checking balance, withdrawing money, depositing money, and exiting. Based on the user's selection, it performs the appropriate transaction by updating the balance variable and displaying the current balance. This repeats until the user chooses to exit the program.
![# 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;](https://image.slidesharecdn.com/atmmachine-110921034318-phpapp01/75/Atm-machine-using-c-1-2048.jpg)
![cout.setf(ios::fixed);
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-110921034318-phpapp01/85/Atm-machine-using-c-2-320.jpg)