-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlms.cpp
More file actions
418 lines (350 loc) · 13.1 KB
/
lms.cpp
File metadata and controls
418 lines (350 loc) · 13.1 KB
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
#include <iostream>
#include <string>
#include <windows.h>
using namespace std;
HANDLE h=GetStdHandle(STD_OUTPUT_HANDLE);
void mainMenu();
int choice();
void home();
int myCourses();
void dashboard();
void dashboardChoice();
void grades();
void eventCalender();
void feedback();
string chat();
void announcements();
void selectCourse(int courseChoice);
int goBack();
void departmentChoice();
void computingChoice();
void gpaCalculation();
void gpaCalculation(){
cout<<"-------------------------------------"<<endl;
cout<<" GPA Calculation "<<endl;
cout<<"-------------------------------------"<<endl;
cout<<"Enter the number of subjects: ";
int subjects;
cin>>subjects;
int totalCredits = 0;
float totalGPA = 0;
for (int i = 0; i < subjects; i++){
int credits;
float gpa;
cout<<"Enter the credits for subject "<<i+1<<": ";
cin>>credits;
cout<<"Enter the GPA for subject "<<i+1<<": ";
cin>>gpa;
totalCredits += credits;
totalGPA += credits * gpa;
}
float gpa = totalGPA / totalCredits;
cout<<"Your GPA is: "<<gpa<<endl;
goBack();
}
//home 2nd part
void computingChoice(){
int computingChoice;
cout<<"Select a course (e.g., 1 for BSc in Information Technology): ";
cin>>computingChoice;
if (computingChoice == 1){
cout<<"--------------------------------------------------"<<endl;
cout<<" BSc in Information Technology "<<endl;
cout<<"--------------------------------------------------"<<endl;
cout<<" * To explore new world Technology"<<endl;
goBack();
} else if (computingChoice == 2){
cout<<"------------------------------------------------"<<endl;
cout<<" BSc in Software Engineering "<<endl;
cout<<"------------------------------------------------"<<endl;
cout<<" * To explore new world Technology"<<endl;
goBack();
}
}
void departmentChoice() {
int departmentChoice;
cout << "Select a department (e.g., 1 for Computing): ";
cin >> departmentChoice;
if (departmentChoice == 1) {
cout << "-------------------------------------" << endl;
cout << " School of Computing " << endl;
cout << "-------------------------------------" << endl;
cout << " * 1.Bachelor of Science Honours in Information Technology" << endl;
cout << " * 2.Bachelor of Science Honours in software engineering"<<endl;
computingChoice();
}
else if (departmentChoice == 2) {
cout << "-------------------------------------" << endl;
cout << " School of Business " << endl;
cout << "-------------------------------------" << endl;
cout << " * 1.Bachelor of Business Administration" << endl;
cout << " * 2.Bachelor of Business Administration in Marketing" << endl;
}
else if (departmentChoice == 3) {
cout << "-------------------------------------" << endl;
cout << " School of Education " << endl;
cout << "-------------------------------------" << endl;
cout << " * 1.Bachelor of Education in Primary Education" << endl;
cout << " * 2.Bachelor of Education in Secondary Education" << endl;
}
else if (departmentChoice == 4) {
cout << "------------------------------------------------------" << endl;
cout << " School of Psychology & Counselling " << endl;
cout << "------------------------------------------------------" << endl;
cout << " * 1.Bachelor of Science in Psychology" << endl;
cout << " * 2.Bachelor of Science in Counselling" << endl;
}
}
int goBack(){
int goBack;
cout<<"Enter 1 to go back: ";
cin>>goBack;
if (goBack == 1){
mainMenu();
choice();
}
return goBack;
}
void announcements(){
cout<<"* Dear students, Please find the attached document containing the finalized time table for your final exam.We kindly request that you review the timetable carefully to ensure there are no conflicts with your personal schedules. Please be prepared to adhere to the specified timing and locations."<<endl;
cout<<"---------------------------------------------------------------------------------------------------------------"<<endl;
cout<<"* Dear students, You have been assigned to the feedback forms of modules for Year 1 and Year 2 of the IT and SE programs in LMS. Please take the time to fill out the evalution forms carefully. Your feedback is crucial for improving the course and the overall learning experience."<<endl;
cout<<"To access the feedback forms, follow this path: "<<endl;
cout<<"LMS-->DASHBOARD-->FEEDBACK"<<endl;
}
//dashboard 7th part
string chat(){
string message;
cout<<"-------------------------------------"<<endl;
cout<<" Chat "<<endl;
cout<<"-------------------------------------"<<endl;
cout<<"Enter your message: ";
cin.ignore();
getline(cin, message);
cout<<"Message sent!"<<endl;
return message;
}
//dashboard 6th part
void feedback(){
cout<<"-------------------------------------"<<endl;
cout<<" Feedback "<<endl;
cout<<"-------------------------------------"<<endl;
cout<<"Please provide your feedback: ";
string feedback;
cin.ignore();
getline(cin, feedback);
cout<<"Thank you for your feedback!"<<endl;
}
//dashboard 5th part
void eventCalender(){
cout<<"-------------------------------------"<<endl;
cout<<" Event Calender "<<endl;
cout<<"-------------------------------------"<<endl;
cout<<"Upcoming Events"<<endl;
cout<<"-------------------------------------"<<endl;
cout<<"FOP Project due: 08th November 2024"<<endl;
cout<<"HTML is due: 12th November 2024"<<endl;
cout<<"MSE in class assignment due: 22th November 2024"<<endl;
cout<<"FOC in class assignment due: 23th November 2024"<<endl;
cout<<"Final exam: 25th November 2024"<<endl;
}
//dashboard 4th part
void grades(){
cout<<"-------------------------------------"<<endl;
cout << " Grades " << endl;
cout<<"-------------------------------------"<<endl;
cout<<"Subject Grade"<<endl;
cout<<"BSSE 11044 90%"<<endl;
cout<<"BSSE 11024 85%"<<endl;
cout<<"BSSE 11033 95%"<<endl;
cout<<"BSSE 11012 87%"<<endl;
cout<<"BSSE 21062 97%"<<endl;
cout<<"-------------------------------------"<<endl;
cout<<"To calculate GPA press 1 or to exit press anyother key"<<endl;
int gpaCalculationChoice;
cin>>gpaCalculationChoice;
if (gpaCalculationChoice == 1){
gpaCalculation();
}else{
goBack();
}
}
//dashboard 2nd part
void dashboardChoice(){
int dashboardChoice;
cout << "Enter your choice: ";
cin >> dashboardChoice;
if (dashboardChoice == 1){
grades();
goBack();
} else if (dashboardChoice == 2){
eventCalender();
goBack();
} else if (dashboardChoice == 3){
feedback();
goBack();
} else if (dashboardChoice == 4){
chat();
goBack();
}
}
//dashboard 1st part
void dashboard(){
cout<<"1.Grades"<<endl;
cout<<"2.Event Calender"<<endl;
cout<<"3.Feedback"<<endl;
cout<<"4.Chat"<<endl;
}
int myCourses(){
cout<<"Courses available:"<<endl;
cout<<"1. BSSE 11044- Mathematics for SE"<<endl;
cout<<"2. BSSE 11024- Fundementals of programming"<<endl;
cout<<"3. BSSE 11012- Foundations in Computing"<<endl;
cout<<"4. BSSE 11033- Fundementels of Web design"<<endl;
cout<<"5. BSSE 21062- Ethical & professional issues in Computing"<<endl;
int courseChoice;
cout<<"Enter the course number you want to learn: ";
cin>>courseChoice;
selectCourse(courseChoice);
return courseChoice;
}
void course1(){
cout<<"Welcome to Mathematics for SE"<<endl;
cout<<"-------------------------------------"<<endl;
cout<<"Course code: BSSE 11044"<<endl;
cout<<"This course is about learning Mathematics for Software Engineers"<<endl;
cout<<"Assignments"<<endl;
cout<<"Quizzes"<<endl;
cout<<"Final Exam"<<endl;
cout<<"Course Duration: 6 months"<<endl;
cout<<"Course Start Date: 1st June 2024"<<endl;
cout<<"Course End Date: 28th November 2024"<<endl;
cout<<"-------------------------------------"<<endl;
goBack();
}
void course2(){
cout<<"Welcome to Fundamentals of Programming"<<endl;
cout<<"-------------------------------------"<<endl;
cout<<"Course code: BSSE 11024"<<endl;
cout<<"This course is about learning Fundamentals of Programming"<<endl;
cout<<"Assignments"<<endl;
cout<<"Quizzes"<<endl;
cout<<"Final Exam"<<endl;
cout<<"Course Duration: 6 months"<<endl;
cout<<"Course Start Date: 1st June 2024"<<endl;
cout<<"Course End Date: 28th November 2024"<<endl;
cout<<"-------------------------------------"<<endl;
goBack();
}
void course3(){
cout<<"Welcome to course 3"<<endl;
cout<<"-------------------------------------"<<endl;
goBack();
}
void course4(){
cout<<"Welcome to course 4"<<endl;
cout<<"-------------------------------------"<<endl;
goBack();
}
void course5(){
cout<<"Welcome to course 5"<<endl;
cout<<"-------------------------------------"<<endl;
goBack();
}
void selectCourse(int courseChoice){
if (courseChoice == 1) {
course1();
} else if (courseChoice == 2) {
course2();
} else if (courseChoice == 3) {
course3();
} else if (courseChoice == 4) {
course4();
} else if (courseChoice == 5) {
course5();
}
}
//home 1st part
void home(){
cout<<"-------------------------------------"<<endl;
cout<<" Site Announcements "<<endl;
cout<<"-------------------------------------"<<endl;
announcements();
cout<<"-------------------------------------"<<endl;
cout<<" Department "<<endl;
cout<<"-------------------------------------"<<endl;
cout<<"1.School of Computing"<<endl;
cout<<"2.School of Business"<<endl;
cout<<"3.School of Education"<<endl;
cout<<"4.School of Psychology & Counselling"<<endl;
departmentChoice();
goBack();
}
int choice(){
int choice;
cout<<"Enter your choice: ";
cin>>choice;
if (choice == 1) {
cout<<"-------------------------------------"<<endl;
cout << " Home " << endl;
cout<<"-------------------------------------"<<endl;
home();
} else if (choice == 2) {
cout<<"-------------------------------------"<<endl;
cout << " Dashboard " << endl;
cout<<"-------------------------------------"<<endl;
dashboard();
dashboardChoice();
} else if (choice == 3) {
cout<<"-------------------------------------"<<endl;
cout << " My Courses " << endl;
cout<<"-------------------------------------"<<endl;
myCourses();
} else if (choice == 4) {
cout<<"-------------------------------------"<<endl;
cout << " Logout " << endl;
cout<<"-------------------------------------"<<endl;
exit(0);
}
return choice;
}
void mainMenu(){
SetConsoleTextAttribute(h,1);
cout<<"1.Home"<<endl;
cout<<"2.Dashboard"<<endl;
cout<<"3.My Courses"<<endl;
cout<<"4.Logout"<<endl;
SetConsoleTextAttribute(h,7);
}
bool login(const string& username, const string& password, const string usernames[], const string passwords[], int size) {
for (int i = 0; i < size; i++) {
if (username == usernames[i] && password == passwords[i]) {
return true; // Login successful
}
}
return false; // Login failed
}
int main() {
const int size = 10;
string usernames[size] = {"admin", "user","c"};
string passwords[size] = {"password", "123456","c"};
string username, password;
SetConsoleTextAttribute(h,2);
cout<<"-------------------------------------"<<endl;
cout << " Welcome to BCI Campus" << endl;
cout<<"-------------------------------------"<<endl;
cout << "Enter username: ";
cin >> username;
cout << "Enter password: ";
cin >> password;
// Call the login function
if (login(username, password, usernames, passwords, size)) {
cout << "Login successful! Welcome back "<<username << endl;
mainMenu();
choice();
} else {
cout << "Login failed! (Invalid username or password)" << endl;
main();
}
return 0;
}