CS102/enrolment
Report
enrolment›run configurations›Admin session

run configuration· admin session

Admin session

Type admin at the role prompt. Fourteen options manage accounts, courses and reports. Only the two profile updates save immediately; the rest is written on exit.

Demo login 1122334455 / Default12345

14 options

At a glance#

Helpers.showAdminMenu()---------Administrator Menu---------
1. Add Students.
2. Remove Students.
3. View student list.
4. Add Instructors.
5. Remove Instructors.
6. View instructor list.
7. Add Course.
8. Close Course.
9. Update Student Info.
10. Update Instructor Info.
11. Assign Instructor to Course.
12. View Enrollment Statistics.
13. Generate Reports.
14. Logout.
  1. roleadmin
  2. loginHelpers.login<Administrator>
  3. menuHelpers.showAdminMenu()
  4. optiongetSafeIntInput("Option: ")
  5. handleswitch (choice)
  6. loopuntil Logout

2 of 14 options write to disk straight away. The rest change the in-memory lists, which are saved when someone types exit.

#Menu textmain() callsPersistence
1Add Students.Helpers.addStudent(loggedInAdministrator, getAllStudents())on exit
2Remove Students.Helpers.removeStudent(loggedInAdministrator, getAllStudents())on exit
3View student list.loggedInAdministrator.viewStudentList(getAllStudents())on exit
4Add Instructors.Helpers.addInstructor(loggedInAdministrator, getAllInstructors())on exit
5Remove Instructors.Helpers.removeInstructor(loggedInAdministrator, getAllInstructors())on exit
6View instructor list.loggedInAdministrator.viewInstructorList(getAllInstructors())on exit
7Add Course.Helpers.addCourse(loggedInAdministrator, getAllCourses(), getAllInstructors())on exit
8Close Course.Helpers.closeCourse(loggedInAdministrator, getAllCourses())on exit
9Update Student Info.Helpers.adminUpdateStudentProfile(...); saveStudents()saves students.txt
10Update Instructor Info.Helpers.adminUpdateInstructorProfile(...); saveInstructors()saves instructors.txt
11Assign Instructor to Course.Helpers.assignInstructor(loggedInAdministrator, getAllCourses(), getAllInstructors())on exit
12View Enrollment Statistics.dataManagerInstance.viewEnrollmentStatistics()on exit
13Generate Reports.dataManagerInstance.generateReports()on exit
14Logout.loggedInAdministrator.logout(loggedInAdministrator)on exit

flow + example output

Every option#

1

Add Students.

Create a student with a generated 10-digit ID.

  1. inputEnter student name: (more than 3 characters)
  2. processGenerateRandomID() until the ID is unused
  3. inputPassword, email, phone number, address, each validated
  4. inputEnter credit limit:
  5. processAdministrator.addStudent appends it
Added
Student added: Huda Nasser with the ID: 8301945526
2

Remove Students.

Remove by ID using an Iterator.

  1. inputEnter the ID of the student to remove:
  2. processIterator walks the list and removes the match
  3. outputThen always prints “Invalid option.” (see Known issues)
Removed
Noura Saleh with the ID: 2200000002 has been successfully removed
Unknown ID
2299999999 is not found.
3

View student list.

One line per student.

  1. outputtoString() of every student
Students
-ID: 2200000001 Name: Sara Khalid
Empty
No students are on record.
4

Add Instructors.

Like adding a student, without a credit limit.

  1. inputEnter instructor name:
  2. processGenerate a unique random ID
  3. inputPassword, email, phone number, address, each validated
Added
Instructor added: Reem Aziz with the ID: 5172039486
5

Remove Instructors.

Remove by ID using an Iterator.

  1. inputEnter the ID of the instructor to remove:
  2. processIterator removes the match
Removed
Omar Faris with the ID: 4000000002 removed successfully.
Unknown ID
Instructor with the ID: 4999999999 not found.
6

View instructor list.

One line per instructor.

  1. outputtoString() of every instructor
Instructors
-ID: 4000000001 Name: Lina Haddad
Empty
No instructors are on record.
7

Add Course.

Name, code, capacity, hours, optional instructor, then Open or Closed.

  1. inputEnter course name: / Enter course code:
  2. inputEnter course capacity: / Enter course credit hours:
  3. input1. Assign now. 2. Assign later.
  4. inputEnter course status: 1. Open 2.Closed
  5. processAdministrator.addCourse appends it
Added
Course added: (Operating Systems) (CS330) succesfully.
Assigned now
Instructor Lina Haddad is assigned to Operating Systems
Assign later
To be assigned.
No instructors
No instructors available. Please add an instructor before creating a course.
8

Close Course.

Find by exact name and code; only a full course is closed.

  1. inputEnter course name: / Enter course code:
  2. checkFull → close it. Already closed → say so.
Full
Physics I is at full capacity.
Already closed
Technical Writing enrollment status is closed.
Not found
Course not found.
Open, not full
(prints nothing, stays open)
9

Update Student Info.

Find by name and ID, then update fields, role and credit limit.

  1. inputStudent's name: / Student ID:
  2. inputYes/No for name, password, email, phone, address
  3. inputDo you want to change the role? / credit limit?
  4. savestudents.txt is rewritten straight away
Updated
Student Sara Khalid's profile updated successfully.
10

Update Instructor Info.

Find by name and ID, then update fields and role.

  1. inputEnter instructor name: / Enter instructor ID:
  2. inputYes/No for each field, then the role
  3. saveinstructors.txt is rewritten straight away
Updated
Instructor Lina Haddad's profile updated successfully.
11

Assign Instructor to Course.

Pick a course by number, then an instructor by ID.

  1. output---------Available Courses---------
  2. inputEnter the number of the course to assign the instructor to:
  3. inputEnter the ID of the instructor to assign:
  4. checkCourse has no instructor yet
Assigned
Instructor Omar Faris is assigned to Physics I
Same instructor
Instructor Lina Haddad is already assigned to Programming II
Taken
Course already has a different instructor assigned.
Unknown ID
Instructor with ID 4999999999 not found.
12

View Enrollment Statistics.

Per-course counts, the total, and whether anything is open.

  1. processCount each course's roster and add them up
  2. outputOne line per course, then two summary lines
Report
See Reports & statistics for the full output
13

Generate Reports.

The single most popular course.

  1. processTrack the course with the most enrolled students
Report
Most popular course: Programming II (CS102) - Enrolled: 2.
No enrolments
No enrollments found.
14

Logout.

Return to the role prompt.

  1. processlogout() returns a message, but main() does not print it
Back to
Enter your role from the current options: (Student/Instructor/Admin) or exit to finish.