-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAdmin.cpp
95 lines (84 loc) · 2.12 KB
/
Admin.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
91
92
93
94
//Admin.cpp
#include"Admin.h"
Admin::Admin(){
setRole("Admin");
}
Client* Admin::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;
}
Teller* Admin::addTeller(){
Teller* a1 = new Teller;
string dob, first, last, ID, pswd;
cout<<"Please enter User ID, Password, First name, last name, and date of birth for new teller: ";
cin>> ID>> pswd>> first>> last>> dob;
a1->setID(ID);
a1->setPass(pswd);
a1->setDOB(dob);
a1->setFullNm(first, last);
return a1;
}
Admin* Admin::addAdmin(){
Admin* a1 = new Admin;
string dob, first, last, pswd, ID;
cout<<"Please enter User ID, Password, First name, last name, and date of birth for new admin: ";
cin>> ID>> pswd>> first>> last>> dob;
a1->setID(ID);
a1->setPass(pswd);
a1->setDOB(dob);
a1->setFullNm(first, last);
return a1;
}
void Admin::viewLog(){
//inprogress
}
void Admin::print(){
cout<<"Admin Account\n";
Account::print();
}
string Admin::toString(){
string output;
output=Account::toString();
return output;
}
int Admin::menu(){ //admin menu
int choice;
cout <<"ATM\n"
<<"~~~~~~~~~~~~~~~~~~\n"
<<"1. Add client\n"
<<"2. Add teller\n"
<<"3. Add admin\n"
<<"4. View log\n" //Audit
<<"5. 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: addTeller();
break;
case 3: addAdmin();
break;
case 4:viewLog();
break;
case 4: cout <<"Goodbye";
break;
default: cout << "Invalid option!\n";
}
system("PAUSE");
}while(option != 5);
}