Oct 13, 2013 at 4:27pm UTC
Alright I'm not quit sure what a class is but does the following programing contain any
Menubuilder.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#ifndef _MenuBuiler_CPP_
#define _MenuBuilder_CPP_
#include "Menubuilder.h"
double balance =2439.45;
double Amount;
double Ebalance;
void checkBal()
{
cout<<"current balance is:$" <<balance<<endl;
}
double withD()
{
cout<<"How much would you like to withdraw?\n" ;
cin>>Amount;
Ebalance= balance - Amount;
cout<<"current balance remaining:$ " <<Ebalance<<endl;
return Ebalance;
}
double Depo()
{
cout<<"how much would you like to deposit?\n" ;
cin>>Amount;
Ebalance= balance +Amount;
cout<<"current balance remaining:$ " <<Ebalance<<endl;
return Ebalance;
}
void AccountI()
{
cout<<"Name: \t Samantha Jane\n" ;
cout<<"Account number:\t 1234554321" <<endl;
}
void VeiwState()
{
cout<<"01/01/11 - McDonald's - $6.27\n" ;
cout<<"01/15/11 - Kwik Trip - $34.93\n" ;
cout<<"02/28/11 - Targer - $124.21" <<endl;
}
void BankI()
{
cout<<"Devry Bank, established 2011\n" ;
cout<<"(123) 456-7890\n" ;
cout<<"12345 1st St.\n" ;
cout<<"somplace, NJ 12345" ;
}
int Exit()
{
return 0;
}
#endif // !1
TestMenu.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
#ifndef _TestMenu_CPP_
#define _TestMenu_CPP_
#include "Menubuilder.h"
// !1
int Choice;
using namespace std;
int main()
{
while (Choice !=7 )
{
cout<<"\t\n" ;
cout<<"Welcome to the DeVry Bank Automated Teller Machine\n" ;
cout<<"1.Check balance\n" ;
cout<<"2.Make withdrawal\n" ;
cout<<"3.Make deposit\n" ;
cout<<"4.View account information\n" ;
cout<<"5.View statement\n" ;
cout<<"6.View bank information\n" ;
cout<<"7.Exit" <<endl;
cin>>Choice;
switch (Choice)
{
case 1: checkBal();
break ;
case 2: withD();
break ;
case 3: Depo();
break ;
case 4: AccountI();
break ;
case 5: VeiwState();
break ;
case 6: BankI();
break ;
case 7: Exit();
break ;
}
}
}
#endif
MenuBuiler.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#ifndef MenuBilder_H_
#define MenuBuilder_H_
#include <iostream>
#include <iomanip>
using namespace std;
extern double Amount;
extern double Ebalance;
extern int Choice;
void checkBal();
double withD();
double Depo();
void AccountI();
void VeiwState();
void BankI();
int Exit();
#endif
And if not how could I possible implement a few into it .
Last edited on Oct 13, 2013 at 4:28pm UTC
Oct 13, 2013 at 4:36pm UTC
a) you dont need include guards in a .c(pp) file
b) there arent any user made classes in that file. you can tell its a class or data structure by seeing the keywords class or struct
Last edited on Oct 13, 2013 at 4:36pm UTC