-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofessor.cpp
More file actions
34 lines (32 loc) · 947 Bytes
/
professor.cpp
File metadata and controls
34 lines (32 loc) · 947 Bytes
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
#include <bits/stdc++.h>
#include "courses.cpp"
class professor : private new_course
{
private:
std::string pass = "teacher_password";
public:
void see_students_in_my_course()
{
std ::string teacher_password;
std ::cin >> teacher_password;
if (pass == teacher_password)
{
std ::cout << "course name :: " << get_course_name() << " course id :: " << get_course_id() << std ::endl;
std ::cout << "\n\tStudents in my course are:\n";
for (int i = 0; i < enrolled_students.size(); i++)
{
std ::cout << enrolled_students[i] << std::endl;
}
}
else
{
std::cout << "Enter valid password\n";
static int retry = 3;
retry--;
if (retry)
see_students_in_my_course();
else
std::cout << "Go Away Hacker\n";
}
}
};