diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index 8695a8c..e44611f 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -552,8 +552,11 @@ public class Administration { return false; } - public void viewGradesFromStudent(String studentId) { + public void viewGradesFromStudent() { + System.out.print("Enter Student ID to view grades: "); + String studentId = scanner.next(); Student student = findStudentById(studentId); + if (student != null) { student.printGrades(); } else { diff --git a/src/main/java/org/example/Main.java b/src/main/java/org/example/Main.java index c1b1e87..8c45a49 100644 --- a/src/main/java/org/example/Main.java +++ b/src/main/java/org/example/Main.java @@ -96,9 +96,7 @@ public class Main { break; case 10: // View Grades from Student - System.out.print("Enter Student ID to view grades: "); - String studentId = scanner.next(); - administration.viewGradesFromStudent(studentId); + administration.viewGradesFromStudent(); break; case 11: