Tuesday 13 November 2012

C++ mini project:Project on ATM machine working


/*program of ATM machine working....*/

#include<string.h>
#include<iostream.h>
#include<conio.h>
class Atm               //classname......//
{
int choice,i;
float b,c;
char str[7];
public:
void get();              //function declaration.....//
};
void Atm::get()
{
cout<<"\tEnter Your Password: ";         //ATM  password(ABCDE)...//
for(i=0;i<=4;i++)
{
str[i]=getch();
cout<<"*";
}
str[i]='\0';
if(strcmp(str,"ABCDE")==0)
{
float a=30000;                         //ATM's front page....//
cout<<endl<<endl<<"\t** WELCOME TO SBI **"<<endl<<endl;
cout<<" \tHello Mr.Manoj Patel\t"<<endl<<endl<<endl;
cout<<"\t1.Information.\t2.Balence inquiry.";
cout<<endl<<endl<<"\t3.Withdrawal\t4.Quit";
cout<<endl<<endl<<endl<<"\t-->please select your choice:";
cin>>choice;
switch(choice)
{
case 1:
cout<<endl<<endl<<"\tName-Pushpendra Pathak"<<endl<<endl;
cout<<"\tAccount no.-0181cs081057"<<endl<<endl<<"\tBranch name-Bhopal";
cout<<endl<<endl<<"\tYour main balence is:"<<a<<endl<<endl<<endl<<"\t\tThank U";
break;
case 2:
cout<<endl<<"\tYour balence is: "<<a<<endl<<endl<<endl<<"\t  Thank U  ";
break;
case 3:
cout<<endl<<"\tyour balence is: "<<a<<endl;
cout<<endl<<"\tPlease enter your ammount:";
cin>>b;
if(b>a)
{
cout<<endl<<endl<<"\tyou have not sufficient balence";
goto out;
}
else
{
c=a-b;
cout<<endl<<endl<<"\tyou have withdrawn Rs. "<<b;
cout<<endl<<endl<<"\tYour balence now:"<<c<<endl<<endl<<"\tThank U";
break;
}
out:
default:
cout<<endl<<endl<<"\tThank U";
}
}
else
{
cout<<endl<<endl<<"\tPassword incorrect";
cout<<endl<<endl<<"\tThank U";
 }
}
void main()
{
clrscr();
Atm A;
A.get();
getch();
}


1 comment:

  1. Hi, Nice Blog!!
    Are you looking for instant money transfer services at your doorstep ? ROINET domestic money transfer services allow you to enjoy all the financial services at your doorstep in rural and unbanked areas.

    ReplyDelete