-
Notifications
You must be signed in to change notification settings - Fork 1
/
Teller.cpp
90 lines (80 loc) · 1.98 KB
/
Teller.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//Teller.cpp
#include"Teller.h"
Teller::Teller(){
setRole("Teller");
}
Client* Teller::addClient(){
Client* a1 = new Client;
string dob, first, last, ID, pswd;
cout<<"Please enter User ID, Password, First name, last name, and date of birth for new client: ";
cin>> ID>> pswd>> first>> last>> dob;
a1->setID(ID);
a1->setPass(pswd);
a1->setDOB(dob);
a1->setFullNm(first, last);
return a1;
}
void Teller::openAccount(){//ask for username and password call menu
string id, pswd;
int choice;
cout<<"Please enter Clients ID and password: ";
cin>>id, pswd;
for(i=0; i<BankingProject->count;i++){
if(BankingProject->accPTR[i].getRole()=="Client"){
if(BankingProject->accPTR[i].getID()==id && BankingProject->accPTR[i].getPass()==pswd){
do{
choice=BankingProject->accPTR[i].menu();
switch(choice){
case 1://...
}
system("CLS");
}while(choice!=4);
}
}
}
}
void Teller::viewLog(){
//inprogress
}
void Teller::print(){
cout<<"Teller Account\n";
Account::print();
}
string Teller::toString(){
string output;
output=Account::toString();
return output;
}
int Teller::menu(){//teller menu
int choice;
cout <<"ATM\n"
<<"~~~~~~~~~~~~~~~~~~\n"
<<"1. Add client\n"
<<"2. Open Account\n" //turns to client menu
<<"3. View log\n" //Audit
<<"4. EXIT\n"
<<"\nEnter your choice: ";
cin >>choice;
return choice;
}
do
{//choice controlled system
system("CLS");
option = menu();
switch(option)
{
case 1:addClient();
break;
case 2:
openAccount();
break;
case 3:
viewLog();
break;
case 4: cout <<"Goodbye";
break;
default: cout << "Invalid option!\n";
}
system("PAUSE");
}while(option != 4);
}