ASSIGNMENT BANK
ASSIGNMENT BANK
if (pin!= ppin)
{
cout <<"Incorrect PIN!!! Please try again..." << endl;
}
else
{
cout <<"\nWELCOME TO PESOSAFE PHILIPPINE BANK" << endl;
}
} while (pin!=ppin);
do{
cout <<"[A] Deposit" << endl;
cout <<"[B] Withdraw" << endl;
cout <<"[C] Inquire" << endl;
cout <<"[D] Quit" << endl;
cout <<"\nPlease select an option: ";
cin >> opt;
switch (tolower(opt))
{
case 'a':
cout <<"\nCurrent Balance: " << balance << endl;
cout <<"Please enter the AMOUNT you wanted to deposit: ";
cin >> deposit;
balance = balance + deposit;
cout <<"\nThe deposited money was successfully added.\nYour New
Balance is: " <<balance << endl;
cout <<"\n(Press any key to go back to HOME)\n" << endl;
getch ();
break;
case 'b':
do {
cout <<"\nEnter the amount you wanted to withdraw: ";
cin >> withdraw;
if (withdraw>balance)
{
cout <<"Amount was not sufficient. Please try again " <<
endl;
}
else
{
balance = balance - withdraw;
}
} while (withdraw>balance);
cout << "Withdraw was SUCCESSFUL.\nNew Balance: "<<balance<<"\n(Press
any key to go back to HOME)\n" << endl;
getch ();
break;
case 'c':
cout <<"\nYour Current Balance: " <<balance<< endl;
cout <<"\n(Press any key to go back to HOME)\n" << endl;
getch ();
break;
case 'd':
cout <<"\nTHANK YOU, PLEASE COME AGAIN!" << endl;
break;
default:
cout <<"\nInvalid Input!\n" << endl;
}
} while(tolower(opt)!='d');
return 0;
}