-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstudent.cpp
More file actions
73 lines (61 loc) · 2 KB
/
student.cpp
File metadata and controls
73 lines (61 loc) · 2 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
#include "student.h"
#include "utils.h"
#include "login.h"
#include <iostream>
using std::cout, std::cin, std::endl;
Utils& utilsStudent = Utils::getInstance();
Login student;
bool Student::studentMenu(string name) //main menu of student class
{
this->name = name;
int choice;
bool runChoice = true;
while (runChoice)
{
cout << "\033[94m" << R"( ____ _____ _ _ ____ _____ _ _ _____
/ ___|_ _| | | | _ \| ____| \ | |_ _|
\___ \ | | | | | | | | | _| | \| | | |
___) || | | |_| | |_| | |___| |\ | | |
|____/ |_|_ \___/|____/|_____|_| \_| |_|
| _ \ / _ \| _ \_ _|/ \ | |
| |_) | | | | |_) || | / _ \ | |
| __/| |_| | _ < | |/ ___ \| |___
|_| \___/|_| \_\|_/_/ \_\_____|
)" << "\033[0m" << endl;
cout << "Welcome, " << name << "!\n" << endl;
cout << "\033[32m[1]\033[0m View Information" << endl;
cout << "\033[32m[2]\033[0m View Grades" << endl;
cout << "\033[31m[3]\033[0m Logout" << endl;
cout << "Enter your choice: \033[32m";
cin >> choice;
cout << "\033[0m";
utilsStudent.delayAnimation(200);
switch(choice){
case 1: if (viewInformation() == 0) continue;
break;
case 2: if (viewGrade() == 0) continue;
break;
case 3: utilsStudent.logout();
return true;
default:
cout << "Invalid choice, try again" << endl;
utilsStudent.delayAnimation(250);
continue;
}
}
return false;
}
int Student::viewInformation() //sub-menu, views COR in a file
{
utilsStudent.studentInformation(name);
utilsStudent.returnButton(choice);
if (choice == 0) return 0;
return 1;
}
int Student::viewGrade() //sub-menu, views grade in a file
{
utilsStudent.studentGrades(name);
utilsStudent.returnButton(choice);
if (choice == 0) return 0;
return 1;
}