Complete code

This commit is contained in:
2026-05-03 18:09:18 +03:30
parent a5e1b6ebb0
commit 7e56379458
4 changed files with 93 additions and 15 deletions
+20 -3
View File
@@ -70,7 +70,13 @@ public class Main {
boolean success;
switch (choice) {
case 1:
//TODO
success = school.registerStudent(username, password);
if(success){
System.out.println(" Student registered successfully!");
}
else{
System.out.println(" Username already exists!");
}
break;
case 2:
success = school.registerTeacher(username, password);
@@ -103,7 +109,13 @@ public class Main {
switch (choice) {
case 1:
//TODO
Student student = school.loginStudent(username, password);
if(student != null){
studentMenu(student);
}
else{
System.out.println(" Invalid username or password!");
}
break;
case 2:
Teacher teacher = school.loginTeacher(username, password);
@@ -153,7 +165,12 @@ public class Main {
}
private static void enrollInCourse(Student student) {
//TODO
System.out.println("\n Select a course:\n");
school.getAllCoursesDisplay();
System.out.println();
String courseName = scanner.toString();
Course course = school.findCourseByName(courseName);
student.enrollInCourse(course);
}
// ==================== TEACHER MENU ====================