-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfessor.java
More file actions
95 lines (78 loc) · 3.38 KB
/
Professor.java
File metadata and controls
95 lines (78 loc) · 3.38 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
import java.util.*;
import java.util.Scanner;
public class Professor{
private String email;
private String name;
private String password;
private List<ProfessorCourses> prof_courses;
Scanner scanner=new Scanner(System.in);
Professor(String name,String email){
this.name=name;
this.email=email;
this.prof_courses=new ArrayList<>();
}
Professor(String name,String email,String password,List<ProfessorCourses> prof_courses){
this.name=name;
this.email=email;
this.password=password;
this.prof_courses=prof_courses;
}
public void setprofcourses(List<ProfessorCourses> prof_courses){
this.prof_courses=prof_courses;
}
public String getemail(){
return email;
}
public String getname(){
return name;
}
public String getpassword(){
return password;
}
public List<ProfessorCourses> getprofcourses(){
return prof_courses;
}
public void addcourse(Courses course, String syllabus,int enrollement_limits,String office_hours){
ProfessorCourses newprofcourse=new ProfessorCourses(course.getCourseCode(),course.getTitle(),getname(),course.getCredits(),course.getPrerequisites(), course.getTimings(),syllabus, enrollement_limits,office_hours );
prof_courses.add(newprofcourse);
}
public void viewEnrolledStudents(Courses course, List<Student> allStudents) {
if (!prof_courses.contains(course)) {
System.out.println("You are not teaching this course.");
return;
}
System.out.println("Students enrolled in " + course.getTitle() + ":");
for (Student student : allStudents) {
if (student.getRegisteredCourses().contains(course)) {
System.out.println("Student Name: " + student.getName());
System.out.println("Email: " + student.getEmail());
System.out.println("Academic Progress: ");
student.academic_progress();
System.out.println();
}
}
}
public void veiwprofcourses(){
if(prof_courses.isEmpty()){
System.out.println("Admin has not assigned any courses yet!");
return;
}
int count=1;
for(ProfessorCourses newcourse:prof_courses){
System.out.println(count+")");
count++;
newcourse.displayCourseDetails();
}
}
public void changecoursedetails(){
System.out.println("Out of these courses enter the course number you want to edit: ");
veiwprofcourses();
if(prof_courses.isEmpty()){
System.out.println("No courses assigned! ");
return;
}
int option=scanner.nextInt();
scanner.nextLine();
prof_courses.get(option-1).editcourse();
}
}