CS102/enrolment
Report
enrolment›run configurations›Student session

run configuration· student session

Student session

Type student at the role prompt, log in, and an 8-option menu loops until you log out. Most changes stay in memory until the program exits.

Demo login 2200000001 / Student1234

8 options

At a glance#

Helpers.showStudentMenu()---------Student Menu---------
1. View avaliable courses.
2. Enroll in course.
3. View enrolled courses.
4. View credit limit.
5. Drop course.
6. View grades.
7. Update personal information.
8. Logout.
  1. rolestudent
  2. loginHelpers.login<Student>
  3. menuHelpers.showStudentMenu()
  4. optiongetSafeIntInput("Option: ")
  5. handleswitch (choice)
  6. loopuntil Logout

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

#Menu textmain() callsPersistence
1View avaliable courses.loggedInStudent.viewAvailableCourses(getAllCourses())on exit
2Enroll in course.Helpers.enroll_In_Course_Student(getAllCourses(), loggedInStudent)on exit
3View enrolled courses.loggedInStudent.viewEnrolledCourses()on exit
4View credit limit.loggedInStudent.viewCreditLimit(getAllStudents())on exit
5Drop course.Helpers.dropCourse(getAllCourses(), loggedInStudent)on exit
6View grades.loggedInStudent.viewGrades(getAllAssessments())on exit
7Update personal information.Helpers.updateStudentProfile(loggedInStudent); saveStudents()saves students.txt
8Logout.loggedInStudent.logout(loggedInStudent)on exit

flow + example output

Every option#

1

View avaliable courses.

List every course that is open and has space.

  1. outputAvailable courses are:
  2. processLoop over every course
  3. checkNot full and status is Open
  4. outputName, code, schedule, instructor and capacity
A course qualifies
- (Course name: Programming II) (Course code: CS102) (Course schedule: Sun/Tue 10:00) (Course instructor: -ID: 4000000001 Name: Lina Haddad) (Course capacity: 30).
Nothing qualifies
No courses are avaliable.
2

Enroll in course.

Pick from the courses you can join; four rules decide whether it works.

  1. processFilter: not full, Open, not already enrolled
  2. outputNumbered list of those courses
  3. inputEnter the number of the course you would like to enroll in:
  4. checkAlready enrolled? Full? Closed? Over the credit limit?
  5. processAdd course to student and student to course
Enrolled
Sara Khalid enrolled successfully
Already enrolled
You are already enrolled in (Programming II) (CS102).
Course is full
Cannot enroll in Physics I - course is full.
Course is closed
Enrollment status is closed.
Too many hours
Cannot enroll in Data Structures - credit limit exceeded.
Nothing to join
No available courses to enroll in.
Bad number
Invalid selection: 9
3

View enrolled courses.

Print the courses on your timetable.

  1. checkAny enrolled courses?
  2. outputName, code, credit hours and schedule for each
Has courses
1- (Programming II) (CS102) (3). The schedule is: Sun/Tue 10:00.
No courses
Sara Khalid is not enrolled in any courses.
4

View credit limit.

Show the credit limit and the hours left.

  1. processTake the first student in the list (see Known issues)
  2. outputCredit limit, then limit minus enrolled hours
Always
Your credit limit is: 15
Remaining credit limit is: 12 hours.
5

Drop course.

Drop by course code while enrolment is still open.

  1. inputEnter course code of the course you would like to drop:
  2. checkCode exists (case-insensitive)
  3. checkYou are enrolled, and the course is Open
  4. processRemove the course from your list
Dropped
Sara Khalid has successfully dropped (Programming II) (CS102).
Not enrolled
Sara Khalid is not enrolled in (Technical Writing) (ENG101).
Course closed
Drop period is closed.
Unknown code
No course found with the codeXYZ1'.
6

View grades.

A three-way sub-menu over your Assessment records.

  1. output1. View a specific exam score. 2. View all grades in a course. 3. View total average in a course.
  2. inputOption, then a course number (and an exam type for option 1)
  3. processFilter grades by your ID and the course code
One score
Your Quiz_1 score: 88.0
All grades
Quiz_1: 88.0
Midterm_1: 91.5
Average
Your total average grade in CS102 is: 89.75
No grades
No grades found for this course.
No courses
You are not enrolled in any courses.
7

Update personal information.

Yes/No for password, email, phone and address, each validated.

  1. inputDo you want to change your password? 1.Yes 2.No
  2. checkEach new value must pass its validator
  3. inputSame for email, phone number and address
  4. savestudents.txt is rewritten straight away
Saved
Student Sara Khalid's information updated.
Rejected value
Invalid email. Please try again.
Kept value
password remains unchanged.
8

Logout.

Leave the menu and 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.