You are on page 1of 3

#include <iostream>

using namespace std;

int main()
{
int pincode;
int attempts = 0;
int menu_num;
int btransfer;
int wdraw;
int bal = 10000;
string bank;
int pbills;
int meralco;
int pldt;
int globe;

cout<<"Welcome to VidaBank"<<endl;
cout<< "Please enter your pincode: ";
cin>>pincode;

while ( pincode != 12345 && attempts < 2 )


{
cout<< "Please try again: ";
cin>>pincode;
attempts++;
}

if ( attempts < 2 )
{

cout<< "Access granted"<<endl;

cout<<"1.Check Balance"<<endl<<"2.Withdraw"<<endl<<"3.Bank
Transfer"<<endl<<"4.Pay Bills"<<endl<<"5.Exit"<<endl;

while (menu_num != 5)

switch (menu_num)
{
case 1:
cout<<"Youre current Balance is :"<<bal<<"\n";
break;

case 2:
cout<<"Enter the amount to withdraw: "<<endl<<"Input: ";
cin>>wdraw;
bal = bal - wdraw;
cout<<"Transaction was successful!\n";
break;

case 3:
cout<<"Which bank will you transfer: BDO | BPI | RCBC : ";
cin>>bank;
cout<<" How much will you transfer to "<<bank<<": ";
cin>>btransfer;
bal = bal - btransfer;
cout<<"Transaction successful! You transfer "<<btransfer<<" to
"<<bank<<"\n";
break;

case 4:
cout<<"\nWhat will you pay:"<<endl<<"1.Meralco\n2.Pldt\n3.Globe\nChoose
a number: ";
cin>>pbills;

switch (pbills)
{
case 1:
cout<<"How much will you pay to Meralco: ";
cin>>meralco;
bal = bal - meralco;
cout<<"Transaction successful! You paid "<<meralco<<" to
Meralco\n";
break;

case 2:
cout<<"How much will you pay to PLDT: ";
cin>>pldt;
bal = bal - pldt;
cout<<"Transaction successful! You paid "<<pldt<<" to Pldt\n";
break;

case 3:
cout<<"How much will you pay Globe: ";
cin>>globe;
bal = bal - globe;
cout<<"Transaction successful! You paid "<<globe<<" to Globe\n";
break;

default:
cout<<"Wrong input.";
break;
}

cout<<endl<<"Please choose a number: ";


cin>>menu_num;

}
}

else
{
cout<< "You have entered the wrong PIN number! Please be back after 24
hours.";
}

return 0;
}

You might also like