0% found this document useful (0 votes)
23 views2 pages

ASSIGNMENT BANK

comprog

Uploaded by

Park Jiminshii
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

ASSIGNMENT BANK

comprog

Uploaded by

Park Jiminshii
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Micah G.

Sedigo September 5, 2024


BSCS 1 CC 101
ASSIGNMENT #2
#include <iostream>
#include <cctype>
#include <conio.h>
using namespace std;
int main () {
int pin, ppin=1234;
char opt;
double balance=0.0, deposit, withdraw;
cout <<"PESOSAFE PHILIPPINE BANK\n" << endl;
do {
cout <<"\nPlease enter your PIN: ";
cin>> pin;

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;
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy