#include<iostream.h>
#include<conio.h>
#include <stdlib.h>
int c,p,p1,p2,p3,Strans, Ctrans;
float amount;
int Cbalance = 5000;
int Sbalance = 10000;
char print;
void transaction(){
clrscr();
cout<<"Choose your transaction:";
cout<<"\n\n\n\t\t(1) Balance Inquiry\t\t(2) Withdrawal";
cout<<"\n\nSelect an Option: ";
cin>>p1;
//BALANCE INQUIRY
if(p1==1){
clrscr();
cout<<"\n\n\n\t\t\t(1) Current\t\t(2) Savings";
cout<<"\n\nSelect an Option: ";
cin>>p2;
//Balance Inquiry CURRENT
if(p2==1){
clrscr();
cout<<"\n\n\n\t\t\t Print Receipt?: ";
cout<<"\n\n\n\t\t\t (1) Yes (2) No";
cout<<"\n\nChoose Option: ";
cin>>print;
clrscr();
cout<<"\n\n\n\t\t\t Your balance is: "<<Cbalance;
cout<<"\n\n\n\n\n\t\t Do you want to have another transaction?";
cout<<"\n\n\t\t\t (1) Yes (2) No";
cout<<"\n\n\nChoose Option (1 or 2): ";
cin>>Ctrans;
if(Ctrans==1){
transaction();
}
if(Ctrans==2){
clrscr();
cout<<"\n\n\n\n\t\t\tThank you for banking with us.";
cout<<"\n\t\t\t Please get your card.";
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
//Balance Inquiry SAVINGS
else if(p2==2){
clrscr();
cout<<"\n\n\n\t\t\t Print Receipt?: ";
cout<<"\n\n\n\t\t\t (1) Yes (2) No";
cout<<"\n\nChoose Option (1 or 2): ";
cin>>print;
clrscr();
cout<<"\n\n\n\t\t\t Your balance is: "<<Sbalance;
cout<<"\n\n\n\n\n\t\t Do you want to have another transaction?";
cout<<"\n\n\t\t\t (1) Yes (2) No";
cout<<"\n\n\nChoose Option (1 or 2): ";
cin>>Strans;
if(Strans==1){
transaction();
}
if(Strans==2){
clrscr();
cout<<"\n\n\n\n\t\t\tThank you for banking with us.";
cout<<"\n\t\t\t Please get your card.";
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
//WITHDRAWAL
else if(p1==2){
clrscr();
cout<<"\n\n\n\t\t\t(1) Current\t\t(2) Savings";
cout<<"\n\nSelect an Option: ";
cin>>p3;
//Withdrawal CURRENT
if(p3==1){
clrscr();
cout<<"\n\n\n\t\t\t\tEnter Amount: ";
cin>>amount;
if(amount <= 0){
clrscr();
cout << "\n\n\n\t\t\t Invlaid Amount.";
cout<<"\n\n\t\t\t Please get your card.";
}
if(amount > 0&&amount < 100){
clrscr();
cout<<"\n\n\n\t\t\t Minimum amount is 100";
cout<<"\n\n\n\n\n\t\t Do you want to have another transaction?";
cout<<"\n\n\t\t\t (1) Yes (2) No";
cout<<"\n\n\nChoose Option (1 or 2): ";
cin>>Ctrans;
if(Ctrans==1){
transaction();
}
if(Ctrans==2){
clrscr();
cout<<"\n\n\n\n\t\t\tThank you for banking with us.";
cout<<"\n\t Please get your card.";
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
if(amount>Cbalance){
clrscr();
cout<<"\n\n\n\t\t\t\tInsuficient funds!";
cout<<"\n\n\n\n\n\t\t Do you want to have another transaction?";
cout<<"\n\n\t\t\t (1) Yes (2) No";
cout<<"\n\n\nChoose Option (1 or 2): ";
cin>>Ctrans;
if(Ctrans==1){
transaction();
}
if(Ctrans==2){
clrscr();
cout<<"\n\n\n\n\t\t\tThank you for banking with us.";
cout<<"\n\t Please get your card.";
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
if(amount<=Cbalance&&amount>=100){
clrscr();
cout<<"\n\n\n\n\t\t\t\tBalance: "<<Cbalance - amount;
cout<<"\n\n\n\n\n\t\t Do you want to have another transaction?";
cout<<"\n\n\t\t\t (1) Yes (2) No";
cout<<"\n\n\nChoose Option (1 or 2): ";
cin>>Strans;
if(Strans==1){
transaction();
}
if(Strans==2){
clrscr();
cout<<"\n\n\n\n\t\t\tThank you for banking with us.";
cout<<"\n\t Please get your card and count your money before leaving.";
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
}
//Withdrawal SAVINGS
else if(p3==2){
clrscr();
cout<<"\n\n\n\t\t\t\tEnter Amount: ";
cin>>amount;
if(amount <= 0){
clrscr();
cout << "\n\n\n\t\t\t Invalid Amount.";
cout<<"\n\n\t\t\t Please get your card.";
}
if(amount > 0&&amount < 100){
clrscr();
cout<<"\n\n\n\t\t\t Minimum amount is 100";
cout<<"\n\n\n\n\n\t\t Do you want to have another transaction?";
cout<<"\n\n\t\t\t (1) Yes (2) No";
cout<<"\n\n\nChoose Option (1 or 2): ";
cin>>Strans;
if(Strans==1){
transaction();
}
if(Strans==2){
clrscr();
cout<<"\n\n\n\n\t\t\tThank you for banking with us.";
cout<<"\n\t Please get your card.";
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
if(amount>Sbalance){
clrscr();
cout<<"\n\n\n\t\t\t\tInsuficient funds!";
cout<<"\n\n\n\n\n\t\t Do you want to have another transaction?";
cout<<"\n\n\t\t\t (1) Yes (2) No";
cout<<"\n\n\nChoose Option (1 or 2): ";
cin>>Strans;
if(Strans==1){
transaction();
}
if(Strans==2){
clrscr();
cout<<"\n\n\n\n\t\t\tThank you for banking with us.";
cout<<"\n\t Please get your card.";
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
if(amount<=Sbalance&&amount>=100){
clrscr();
cout<<"\n\n\n\n\t\t\t\tBalance: "<<Sbalance - amount;
cout<<"\n\n\n\n\n\t\t Do you want to have another transaction?";
cout<<"\n\n\t\t\t (1) Yes (2) No";
cout<<"\n\n\nChoose Option (1 or 2): ";
cin>>Strans;
if(Strans==1){
transaction();
}
if(Strans==2){
clrscr();
cout<<"\n\n\n\n\t\t\tThank you for banking with us.";
cout<<"\n\t Please get your card and count your money before leaving.";
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
void main(){
clrscr();
cout<<"\n\n\t\t -----------------------------------------\n";
cout<<"\t\t WELCOME TO BANK OF THE PHILIPPINE ISLANDS\n ";
cout<<"\t\t -----------------------------------------\n";
cout<<"\n\n\t\t (1) Continue\t\t(2) Exit";
cout<<"\n\n\n\nSelect an Option (1 or 2): ";
cin>>c;
//CONTINUE
if(c==1){
clrscr();
cout<<"\n\n\n\t\t\t\tEnter your PIN: ";
cin>>p;
//TRANSACTION
if(p==1234){
transaction();
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\t Wrong PIN!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
//EXIT
else if(c==2){
clrscr();
cout<<"\n\n\t\t\tThank you for banking with us.";
cout<<"\n\n\t\t\t Please get your card.";
}
else{
clrscr();
cout<<"\n\n\n\t\t\t\tInvalid Input!";
cout<<"\n\n\t\t\t Please get your card.";
}
}
getch();
I'm making an ATM interface on C++ for a school project of my friend. How can i change the PIN number into asterisks "*"? P.S. the pin number codes are in the MAIN. thanks :D
I'm making an ATM interface on C++ for a school project of my friend. How can i change the PIN number into asterisks "*"? P.S. the pin number codes are in the MAIN. thanks :D