Embed presentation
Downloaded 155 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=50000;
double withdraw,deposit;
int option;
cout<<"n";
cout<< " *************Aqib memon****************n";
cout<<" *****************Welcome****************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);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"you withdrew Rs:"<<withdraw<<endl;
cout<<"your remainig balance is"<<balance<<endl;
continue;](https://image.slidesharecdn.com/atmmachine-110921092549-phpapp01/75/Atm-machine-using-c-1-2048.jpg)
![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-110921092549-phpapp01/85/Atm-machine-using-c-2-320.jpg)

The document contains code for an automated teller machine (ATM) program. It prompts the user to enter a password, and if correct, displays a menu to make transactions. The menu includes options to check the balance, withdraw or deposit money, and exit. Based on the selection, it performs the transaction and displays the new balance. It loops to re-enter the password if an incorrect one is provided.
![# 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=50000;
double withdraw,deposit;
int option;
cout<<"n";
cout<< " *************Aqib memon****************n";
cout<<" *****************Welcome****************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);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"you withdrew Rs:"<<withdraw<<endl;
cout<<"your remainig balance is"<<balance<<endl;
continue;](https://image.slidesharecdn.com/atmmachine-110921092549-phpapp01/75/Atm-machine-using-c-1-2048.jpg)
![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-110921092549-phpapp01/85/Atm-machine-using-c-2-320.jpg)