-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
201 lines (149 loc) · 3.54 KB
/
main.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
#include <iostream>
//#include "patron.h"
//#include "patrons.h"
//#include "books.h"
#include "loans.h"
using namespace std;
void PrintMenu();
void PrintMenu() {
cout << "MENU" << endl;
cout << "Select an charactar option:" << endl;
cout << " a - Add A Patron" << endl;
cout << " b - Add A Item" << endl;
cout << " o - Check Out" << endl;
cout << " i - Check In" << endl;
cout << " l - Report Lost Item" << endl;
cout << " y - Pay Patron Fine Balance" << endl;
cout << " r - Remove A Patron" << endl;
cout << " t - Remove A Item" << endl;
cout << " p - Print All Patrons" << endl;
cout << " k - Print All Items" << endl;
cout << " j - Print All Check Outs" << endl;
cout << " z - Print All Information" << endl;
cout << " q - Quit" << endl << endl;
cout << " Choose an option: ";
}
int main() {
Patrons pats;
LibrayItems items;
Loans loans;
char uc;
pats.LoadPatrons();
items.LoadItems();
loans.LoadLoans();
loans.UpdateLoanStatus(pats,items);
while( uc != 'q') {
PrintMenu();
cin >> uc;
cin.ignore();
cout << endl << endl;
switch(uc) {
case 'a':
//PrintMenu();
pats.AddPatron();
break;
case 'b':
items.AddItem();
break;
case 'o':
loans.CheckOut(pats,items);
break;
case 'i':
loans.CheckIn(pats,items);
break;
case 'l':
loans.ReportLost(pats,items);
break;
case 'y':
int idy;
pats.PrintPatrons();
cout << "Enter Patron's Id who is paying fines: ";
cin >> idy;
cin.ignore();
pats.PayFines(idy);
break;
case 'r':
int id;
pats.PrintPatrons();
cout << "Enter Patron's who is to be removed: ";
cin >> id;
cin.ignore();
pats.DeletePatron(id);
break;
case 't':
int idi;
items.PrintItems();
cout << "Enter Item's Id that is to be removed: ";
cin >> idi;
cin.ignore();
items.DeleteItem(idi);
break;
case 'p':
pats.PrintPatrons();
break;
case 'k':
items.PrintItems();
break;
case 'j':
loans.PrintPatronCheckOuts();
case 'z':
pats.PrintPatrons();
items.PrintItems();
loans.PrintPatronCheckOuts();
break;
case 'q':
break;
default :
cout << "Not An Options" << endl;
break;
}
}
pats.StorePatrons();
items.StoreItems();
loans.StoreLoans();
//pats.LoadPatrons();
//books.LoadBooks();
//pats.LoadPatrons();
//loans.LoadLoans();
//pats.SetPatronCount(0);
//pats.SetPatronCap(2);
//pats.AddPatron();
//pats.AddPatron();
//pats.AddPatron();
//pats.FindPatron();
//pats.PrintPatrons();
//books.SetBooksCount(0);
//books.SetBooksCap(1);
//books.AddBook();
//books.AddBook();
//books.AddBook();
//books.AddBook();
//books.AddBook();
//books.AddBook();
//books.AddBook();
//books.AddBook();
//books.PrintBooks();
//loans.SetLoansCount(0);
//loans.SetLoansCap(2);
//loans.CheckOut(pats,books);
//loans.CheckOut(pats,books);
//loans.CheckOut(pats,books);
//loans.CheckOut(pats,books);
//loans.CheckOut(pats,books);
//loans.CheckOut(pats,books);
//loans.CheckOut(pats,books);
//loans.CheckOut(pats,books);
//loans.PrintPatronCheckOuts();
//pats.PrintPatrons();
//books.PrintBooks();
//loans.CheckIn(pats,books);
//loans.CheckIn(pats,books);
//loans.PrintPatronCheckOuts();
//pats.PrintPatrons();
//books.PrintBooks();
//loans.PrintPatronCheckOuts();
//pats.StorePatrons();
//books.StoreBooks();
//loans.StoreLoans();
return 0;
}