Jan 8, 2015 at 3:19pm UTC
#include <conio.h>
#include <iostream>
using namespace std;
void balance ();
void withdraw ();
void deposit ();
int x=1,PW,;
char transaction;
main ()
{
start:
cout<<"Enter a Password:";
cin>>PW;
if (PW==143)
{
cout<<end1<<"[A] balance"<<end1<<"[B] withdraw"<<end1<<"[C] deposit"<<end1<<end1<<"choose transaction";
cin>>transaction;
if (transaction=='A')
balance();
else if (transaction=='B')
withdraw();
else if (transaction=='C')
deposit();
}
else
{
if (x!=3)
{
cout<<"Invalid Password!";
x=x+1
goto start;
}
else
{
cout<<"System Blocked!";
goto done;
}
}
done:
getch();
}
void balance ()
{
float a;
cout<<end1;
cout<<"Balance";
cout<<end1<<end1;
cout<<"Enter 1 for savings";
cout<<end1;
cout<<"Enter 2 for current";
cout<<end1<<end1;
cout<<"Choose transaction";
cin>>a;
if (a==1)
cout<<"Balance is p50000";
else if(a==2)
cout<<"Balance is p20000";
else
cout<<"Invalid Input";
}
void withdraw()
{
float c,y;
cout<<end1;
cout<<"withdrawal";
cout<<end1<<end1;
cout<<"Enter 1 to withdraw savings";
cout<<end1;
cout<<"Enter 2 to withdraw current";
cout<<end1;<<end1;
cout<<"Choose transaction";
cin>>c;
if (C==1)
{
cout<<"Enter amount to withdraw:";
cin>>y;
if (y<=50000)
cout<<"Remaining Balance is"<<50000-y;
else
cout<<"Insufficient Balance";
}
if (C==2)
{
cout<<"Enter Amount to withdraw";
cin>>y;
if (y<=20000)
cout<<"Remaining balance is"<<20000-y;
else
cout<<"insufficient balance ";
cin>>c;
}
}
void deposit ()
{ float x,y;
cout<<end1;
cout<<"deposit";
cout<<end1<<end1;
cout<<"Enter 1 for savings";
cout<<end1;
cout<<"Enter 2 for current";
cout<<end1<<end1;
cout<<"choose transaction";
cin>>x;
if (x==1)
{
cout<<"Enter amount to deposit";
cin>>y;
cout<<"New Balance is "<<50000+y;
}
else if (x==2)
cout<<"Enter amount to deposit";
cout<<end1;
cin>>y;
cout<<"New Balance is "<<20000+y;
}
Jan 8, 2015 at 3:40pm UTC
cout<<end1<<"[A] balance" <<end1<<"[B] withdraw" <<end1<<"[C] deposit" <<end1<<end1<<"choose transaction" ;
[error] 'end1' was not declared in this scope
Last edited on Jan 8, 2015 at 3:45pm UTC
Jan 8, 2015 at 3:59pm UTC
That's a letter 'l' not a number '1'. It's endl ine.