Browse Source

refactoring: more clarity for output messages of Course add and delete functions

remotes/origin/fdai7780
fdai7921 11 months ago
parent
commit
0377c71c52
  1. 6
      src/main/java/org/example/Course.java

6
src/main/java/org/example/Course.java

@ -203,7 +203,7 @@ public class Course {
// Add the course using the provided data
addCourse(courseName, courseCode, courseCredit, filename);
System.out.println("Added Course successfully!");
System.out.println(courseName + " added successfully!");
}
/**
@ -231,6 +231,8 @@ public class Course {
int selection = scanner.nextInt();
String toDeleteCourse = courses.get(selection-1).getCourseName();
if (selection == 0) {
return; // Return to the menu
} else if (selection < 1 || selection > courses.size()) {
@ -251,7 +253,7 @@ public class Course {
e.printStackTrace();
}
System.out.println("Course deleted successfully.");
System.out.println(toDeleteCourse + " deleted successfully.");
return;
}
}

Loading…
Cancel
Save