Você está na página 1de 16

ABSTRACT

Having read and worked with the requirements


specifications presented to us by FWH Bank, a
working protocol is now presented to the board
for further considerations. Appropriate
screenshots have accompanied the text to aid
understanding.

Programming in VC++ 2014

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>

//header files required to run the program declared here


//Takudzwa Tizora (c)2014

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

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

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

float menu(){//main menu


do{
system ("cls");
cout<<"***********************************************************"<<endl;
cout<<"******************FWH MAIN MENU***************************"<<endl;
cout<<"***********************************************************"<<endl;
cout<<"***********************************************************"<<endl;
cout<<" 1. CURRENT BALANCE "<<endl;
cout<<"***********************************************************"<<endl;
cout<<endl;
cout<<"***********************************************************"<<endl;
cout<<" 2. WITHDRAW "<<endl;
cout<<"***********************************************************"<<endl;
cout<<endl;
cout<<"***********************************************************"<<endl;
cout<<" 3. DEPOSIT
"<<endl;
cout<<"***********************************************************"<<endl;
cout<<endl;
cout<<"***********************************************************"<<endl;
cout<<" 4. EJECT CARD "<<endl;
cout<<"***********************************************************"<<endl;
cout<<"Please select a banking activity: "<<endl;
cout<<endl;
cin>>activity;
}while(activity<1 || activity>4);
switch(activity){
case 1:
balance ();
break;
case 2:
withdraw ();
break;
case 3:
deposit ();
break;
case 4:
eject ();
}
return 0;
}
float balance ()//method for balance
{
system("cls");
cout<<"\nRetrieving account balance from a/fwhoc.zw..."<<endl;
cout<<"ACCOUNT: "<<acc_num<<endl;
cout<<"Your balance is $ "<<bal<<endl;
system("pause");
menu ();
return 0;
}

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

float withdraw ()//method for withdrawing


{
system("cls");
do{
cout<<"***********************************************************"<<endl;
cout<<"******************FWH WITHDRAWALS
MENU***************************"<<endl;
cout<<"***********************************************************"<<endl;
cout<<"\nPlease select amount you want to withdraw from the listed options
"<<endl;
cout<<"\n 1. $20 (Twenty Dollars Only)"<<endl;
cout<<"\n 2. $40 (Forty Dollars Only)"<<endl;
cout<<"\n 3. $60 (Sixty Dollars Only)"<<endl;
cout<<"\n 4. $80 (Eighty Dollars Only)"<<endl;
cout<<"\n 5. $100 (One Hundred Dollars Only)"<<endl;
cout<<"\n 6. $200 (Two Hundred Dollars Only)"<<endl;
cout<<"\n 7. CANCEL (Exit & Return to Main Menu"<<endl;
cout<<"\nPlease select amount you want to withdraw from the listed options
"<<endl;
cin>>w_opt;
cout<<endl;
}while(w_opt<1 || w_opt>7);
switch(w_opt){
case 1:
if(bal<20){
cout<<"\nINSUFFICIENT FUNDS, SORRY!"<<endl;
cout<<"\nAVAILABLE BALANCE: $"<<bal<<endl;
cout<<endl;
system("pause");
eject ();
}
else
{
cout<<"\nWithdrawing Twenty Dollars from: \nACCOUNT:
"<<acc_num<<endl;
bal = bal-20;
cout<<"New Balance: $ "<<bal<<endl;
}
break;
case 2:
if(bal<40){
cout<<"\nINSUFFICIENT FUNDS, SORRY!"<<endl;
cout<<"\nAVAILABLE BALANCE: $"<<bal<<endl;
cout<<endl;
system("pause");
eject ();
}
else
{
cout<<"\nWithdrawing Forty Dollars from: \nACCOUNT:
"<<acc_num<<endl;
bal = bal-40;
cout<<"New Balance: $ "<<bal<<endl;
}
break;

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

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;

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

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

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

float eject ()//method for ejecting


{
system("cls");
cout<<"***********************************************************"<<endl;
cout<<"******************Fine Weather Holdings Bank***************"<<endl;
cout<<"***********************************************************"<<endl;
cout<<"\nCard ejecting..."<<endl;
cout<<"\nPlease wait..."<<endl;
cout<<"\nCard ejected!"<<endl;
cout<<"\nThank you for using FWH ATM, Marondera.\nPLEASE CALL AGAIN!!!\nTIZORAH
SYSTEMS (C) 2014"<<endl;
cout<<endl;
system("pause");
system("cls");
main ();
return 0;
}
/*
Fine Weather Automated Teller Machine.
Location:
Marondera Old court
Bank:
Tizora Financial Holdings
Designed by: Takudzwa Tizora
*/

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

AUTOMATED TELLER MACHINE | Programming in VC++ 2014

Você também pode gostar