IN C++ please!! Thanks in advance! :) Develop an application that will determine
ID: 639348 • Letter: I
Question
IN C++ please!! Thanks in advance! :) Develop an application that will determine if a debit card has exceeded the amount on the card. The following facts are available and input into the program:
a. Pin number (Four alpha-numeric characters only,will test with 3 or 5 char and 0000), b. Balance initially placed on the card, c. Total of all debits charged by the customer during the month d. Total of all added credits to the debit card.
The program should input each of these facts with the range of an unsigned short, calculate the new balance, display the new balance and debit the account $28.85 if overdrawn. Also, if overdrawn, tell the customer an additional $28.85 fee has been accessed and what the balance whould be with this fee included. In order to allow further charges to occur the card would have to be zeroed out and a new credit balance applied.
Explanation / Answer
#include <iostream>
#include <string>
using namespace std;
int main () {
char c;
system("cls");
cout<<"Welcome to Metrobank:"<<endl;
cout<<"Please choose if you want to use your ATM card"<<endl;
cout<<"or just your USERNAME and PASSWORD ";
cout<<"1. ATM card"<<endl;
cout<<"2. USERNAME"<<endl;
cout<<"any key: CREDITS"<<endl;
cout<<"Select Choice: ";
cin>>c;
switch (c){
case '1':
system ("cls");
int pin;
float account,amount,yes,no;
char ans,opt;
cout<<"Welcome to Metrobank:"<<endl;
cout<<"Please insert your card:"<<endl;
cout<<"Enter pin: ";
cin>>pin;cout<<endl;
if(pin!=930110){
system("cls");
cout<<"invalid Pin"<<endl<<endl;
cout<<"Enter pin: ";
cin>>pin;
if(pin!=930110){
system("cls");
cout<<"invalid Pin"<<endl<<endl;
cout<<"Enter pin: ";
cin>>pin;
if(pin!=930110){
cout<<"invalid Pin"<<endl<<endl;
if(pin!=930110){
cout<<"You have reach the maximum attempt."<<endl;
cout<<"Sorry. You are not allowed to proceed another transaction."<<endl;
cout<<"Please come again after two days."<<endl;
cout<<"Please, get your card."<<endl;
}
}else{
do{
cout<<"Select Transaction:"<<endl;
cout<<"A.Balance Inquiry:"<<endl;
cout<<"B.Withdrawal:"<<endl;
cin>>opt;
switch(opt){
case'A':
case'a':
system("cls");
cout<<"Saving Account=2000:"<<endl;
break;
case'B':
case'b':
system ("cls");
cout<<"Do you want to withdraw?: "<<endl;
cin>>yes or no;
cout<<"Enter amount if you want to withdraw: "<<endl;
cin>>amount;
cout<<"Please wait your transaction is being process: "<<endl;
cout<<"Please get your card,money,receipt: "<<endl;
break;
}
cout<<"Another Transaction?:[]";
cin>>ans;
system("cls");
}while(ans=='y'||ans=='Y');
}}else{
do{
cout<<"Select Transaction:"<<endl;
cout<<"A.Balance Inquiry:"<<endl;
cout<<"B.Withdrawal:"<<endl;
cin>>opt;
switch(opt){
case'A':
case'a':
system("cls");
cout<<"Saving Account=2000:"<<endl;
break;
case'B':
case'b':
system ("cls");
cout<<"Do you want to withdraw?: "<<endl;
cin>>amount;
cout<<"Enter amount if you want to withdraw: "<<endl;
cin>>amount;
cout<<"Please wait your transaction is being process: "<<endl;
cout<<"Please get your card,money,receipt: "<<endl;
break;
}
cout<<"Another Transaction?:[y]";
cin>>ans;
system("cls");
}while(ans=='y'||ans=='Y');
}
}
else{
do{
cout<<"Select Transaction:"<<endl;
cout<<"A.Balance Inquiry:"<<endl;
cout<<"B.Withdrawal:"<<endl;
cin>>opt;
switch(opt){
case'A':
case'a':
system("cls");
cout<<"Saving Account=2000:"<<endl;
break;
case'B':
case'b':
system ("cls");
cout<<"Enter amount if you want to withdraw: "<<endl;
cin>>amount;
cout<<"Please wait your transaction is being process: "<<endl;
cout<<"Please get your card,money,receipt: "<<endl;
break;
}
cout<<"Another Transaction?:[y/n]";
cin>>ans;
system("cls");
}while(ans=='y'||ans=='Y');
}
system("pause");
return main();
break;
case '2':
system("cls");
string Usern,knight,User;
float y,x, pin1;
double balance =0, balance2;
double withdraw, deposit;
int option;
cout<<"if not yet registered please press "1""<<endl;
cout<<"if registered press "2""<<endl;
cin>>x;cout<<endl;
if (x==1){
system("cls");
cout<<"Your Username: ";
cin>>User;cout<<endl;
cout<<"Your Password: ";
cin>>pin1;
return main ();
}if (x=='2'){
system ("cls");
cout<<"Please Enter your Username:"<<endl;
cin>>Usern;cout<<endl;
if (Usern==User){
{
cout <<"Enter Password: "<<endl;
cin>>y;
if (y=123456){
cout<<" ***Welcome to Metrobank***"<<endl;
cout<<"*** Automated Teller Machine***"<<endl;
cout<<"Choose a Transaction: ";
cout<<" ";
cout<<"[1] Inquire Balance "
<<"[2] Withdraw "
<<"[3] Deposit "
<<"[4] Quit "
<<" "
<<"Enter Option:";
cin>>option;
switch(option)
{
case 1:
system("cls");
cout<<" [[[BALANCE INQUIRY]]] ";
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<" Your current balance is $"<<balance2<<endl;
system("pause");
return main();
break;
case 2:
system("cls");
cout<<" [[[WITHDRAW]]] ";
cout<<"Enter amount: $";
cin>>withdraw;
if (balance2<withdraw){
balance = balance2 - withdraw;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"You withdrew $"<<withdraw<<endl;
cout<<"Your remaining balance is $"<<balance<<endl;
}else{
cout<<" you have insufficient balance: "<<endl;
}
system("pause");
break;
case 3:
system("cls");
cout<<" [[[DEPOSIT]]] ";
cout<<"Enter amount: $";
cin>>deposit;
balance2 = balance + deposit;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"You deposited $"<<deposit<<endl;
cout<<"Your new balance is $"<<balance2<<endl;
system("pause");
return main();
case 4:
system("cls");
cout<<" ***[[[EXIT MODE]]]*** ";
system("pause");
break;
default:
cout<<" That is an invalid option ";
system("pause");
return main();
break;
}
}
}
cout<<"Created by: Group 1 BSIT-2 D2"<<endl;
cout<<" the Group Members are:"<<endl;
cout<<" - RONEL ANTATAP"<<endl;
cout<<" - MARK JAMES SORIANO"<<endl;
cout<<" - CHESKA TERADO"<<endl<<endl;
cout <<"thank you: "<<endl;
cout<<"GOD BLESS:"<<endl;
}}}
system("pause");
return 0;
}