Escolar Documentos
Profissional Documentos
Cultura Documentos
HEADER FILES
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#include <iostream>
SOURCE CODE
// FloatATM.cpp : Defines the entry point for the console application.
#include "stdafx.h"
using namespace std;
//global variables
float acc_num;
int activity;
int w_opt;
float dep_amnt;
float neck;
float bal = 500;
//methods
float Welcome ();
float menu();
float balance ();
float withdraw ();
float deposit ();
float eject ();
int main ()//main
{
cout<<"***********************************************************"<<endl;
cout<<"********FWH Welcomes you to ATM, Marondera Oldcourt********"<<endl;
cout<<"***********************************************************"<<endl;
cout<<"Standing by..."<<endl;
cout<<"--INSERT CARD--"<<endl;
system("pause");
Welcome ();
system("pause");
return 0;
}
float Welcome(){//welcome method where user first gets to
system("cls");
cout<<"***********************************************************"<<endl;
cout<<"********FWH Welcomes you to ATM, Marondera Oldcourt********"<<endl;
cout<<"***********************************************************"<<endl;
cout<<"Processing..."<<endl;
cout<<endl;
cout<<"Card detected! Enter 5 digit card activation number..."<<endl;
cin>>acc_num;
cout<<"You entered "<<acc_num<<endl;
cout<<"Would you like to Proceed (1) or Re-enter (2)???"<<endl;
cin>>neck;
system("cls");
while(neck!=1){
cout<<"You entered "<<acc_num<<endl;
cout<<"NOTE THAT ANY INPUT OTHER THAN PROCEED (1) WILL BE CONSIDERED AS
REENTER (2). \nTHANK YOU"<<endl;
cout<<"Please re-enter your 5 digit card activation number..."<<endl;
cin>>acc_num;
cout<<"Would you like to Proceed (1) or Re-enter (2)???"<<endl;
cin>>neck;
}
menu ();
return 0;
}
case 3:
if(bal<60){
cout<<"\nINSUFFICIENT FUNDS, SORRY!"<<endl;
cout<<"\nAVAILABLE BALANCE: $"<<bal<<endl;
cout<<endl;
system("pause");
eject();
}
else{
cout<<"\nWithdrawing Sixty Dollars from: \nACCOUNT:
"<<acc_num<<endl;
bal = bal-60;
cout<<"New Balance: $ "<<bal<<endl;
}
break;
case 4:
if(bal<80){
cout<<"\nINSUFFICIENT FUNDS, SORRY!"<<endl;
cout<<"\nAVAILABLE BALANCE: $"<<bal<<endl;
cout<<endl;
system("pause");
eject ();
}
else{
cout<<"\nWithdrawing Eighty Dollars from: \nACCOUNT:
"<<acc_num<<endl;
bal = bal-80;
cout<<"New Balance: $ "<<bal<<endl;
}
break;
case 5:
if(bal<100){
cout<<"\nINSUFFICIENT FUNDS, SORRY!"<<endl;
cout<<"\nAVAILABLE BALANCE: $"<<bal<<endl;
cout<<endl;
system("pause");
eject ();
}
else{
cout<<"\nWithdrawing Hundred Dollars from: \nACCOUNT:
"<<acc_num<<endl;
bal = bal-100;
cout<<"New Balance: $ "<<bal<<endl;
}
break;
case 6:
if(bal<200){
cout<<"\nINSUFFICIENT FUNDS, SORRY!"<<endl;
cout<<"\nAVAILABLE BALANCE: $"<<bal<<endl;
cout<<endl;
system("pause");
eject ();
}
else{
cout<<"\nWithdrawing Hundred Dollars from: \nACCOUNT:
"<<acc_num<<endl;
bal = bal-200;
cout<<"\nNew Balance: $ "<<bal<<endl;}break;
case 7:
cout<<"\nEXITING WITHDRAWAL MENU..."<<endl;
cout<<"\nReturning to Main Menu..."<<endl;
cout<<"\nPlease wait..."<<endl;
system("pause");
system("cls");
menu ();
break;
}
cout<<"NOTE:\nPLEASE CHECK & SECURE YOUR MONEY BEFORE LEAVING ATM COUNTER."<<endl;
cout<<"ONGORORA/CHERECHEDZA:\nTAPOTA ONAI KUTI MAVERENGA PAMWE NEKUISA \nMARI
YENYU PAKACHENGETEKA MUSATI MASUDURUKA PA KAWINDA YEDU."<<endl;
system("pause");
menu ();
return 0;
}
float deposit ()//method for deposits
{
system("cls");
cout<<"***********************************************************"<<endl;
cout<<"******************Fine Weather Holdings Bank***************"<<endl;
cout<<"***********************************************************"<<endl;
cout<<"\nNOTE:\nPLEASE ENSURE THAT YOU INSERT ENVELOPE WITH NECESSARY DEPOSIT
\nFUNDS FLOATO CHAMBER BELOW. TYPE FIGURE AS CENTS FOR EXAMPLE $10 = 1000 CENTS.
\nTHANK YOU."<<endl;
cout<<"\nONGORORA/CHERECHEDZA:\nTAPOTA ONAI KUTI MAISA HAMVEROPU INE MARI YAMUNODA
\nKUCHENGETESA PAMUKANA URI PAZASI APA. MARI INYOREI SAMA SENZI SEZVIZVI $10 =
1000 CENTS. \nTATENDA."<<endl;
cout<<"\nAMOUNT: "<<endl;
cin>>dep_amnt;
cout<<"\nINSERT ENVELOPE & PRESS ENTER"<<endl;
system("pause");
cout<<"\n>> Please wait while funds are verified..."<<endl;
cout<<"\n>> Total Deposit Amount Entered: "<<dep_amnt/100<<endl;
cout<<"\n>> Total Verified Amount: "<<dep_amnt/100<<endl;
bal= bal+(dep_amnt/100);
cout<<"\nDepositing $"<<dep_amnt/100<<" to:\nACCOUNT: "<<acc_num<<endl;
cout<<"\nNEW BALANCE: $"<<bal<<endl;
cout<<"\nThank you!"<<endl;
cout<<endl;
system("pause");
menu ();
return 0;
}