lab03 : Roster Manager

num ready? description assigned due
lab03 true Roster Manager Mon 04/22 08:00AM Sun 05/05 11:59PM

Goals

For this lab, you will focus on dealing with arrays and Exception handling. You will write a simple class roster program that manages courses and students enrolled in those courses. This program will provide a simple command-line interface that allows users to interact with the application and perform actions such as creating a course, removing a course, enrolling students in a course, and dropping students from a course. Once the program is up and running, you will also write a test suite in JUnit covering various types of cases discussed in class.

Pair Programming

This lab may be done solo, or in pairs.

Before you begin working on the lab, please decide if you will work solo or with a partner.

As stated in previous labs, there are a few requirements you must follow if you decide to work with a partner. I will re-iterate them here:

Once you and your partner are in agreement, choose an initial driver and navigator, and have the driver log into their account.

Instructions

There are many ways a class roster program like this can be accomplished (and one would probably not implement a roster program using a command-line interface). Students to work with arrays and manage these data types manually (rather than using predefined objects such as ArrayLists that already provide most of the functionality for you).

Class Roster Menu

The first thing the user sees is a brief welcome message and a small menu describing commands that the user can make. For example:

Welcome to Class Roster Manager!
Select an action based on the following menu: 
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: 

Since we’ll be dealing with arrays, we will define the limits for both the maximum number of courses the program will keep track of as well as the maximum number of students each course can have, which are 10 and 50 respectively (obviously this does not scale, but that’s not what we’re focusing on for this lab).

Program Behavior

The menu choices are case insensitive and are defined as follows:

ac: Add Course

dc: Drop Course

as: Add Student

ds: Drop Student

p: Print ClassRoster

q: Quit Program

Exceptions

Since there are several scenarios where a brief error is reported, students will practice Exception handling to “fine-tune” the error messages that are displayed to the user. The Exception classes you will need to create are minimal without a body (just to define the Exception type). The Exceptions you will need to create and use in your program are:

Code Organization

Some requirements on the code structure that students will need to follow. Please be sure to follow these naming conventions (do not rename files / classes / methods to something other than what is listed below):

Lab03.java.

RosterManager.java

Course.java

Student.java

ClassRosterUI.java

Testing

Unlike the previous labs, this one will have a large testing component. You will write a test suite in JUnit (as discussed in lecture) going through various cases and confirming your program handles them as expected. To use JUnit, review the notes from Lecture 5.

Write your test suite in a file named ClassRosterTester.java. At the very minimum, you will:

Examples

The following is an example of adding some courses and students to our Roster as well as some (but not all) error cases your program should handle:

Welcome to Class Roster Manager!
Select an action based on the following menu: 
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: ac
Enter Course Code: CS56
Enter Course Name: Advanced Applications Programming
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: as
Enter course code for Student: CS56
Enter PERM: 12345678
Enter last name: Wang
Enter first name: Richert
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: as
Enter course code for Student: CS56
Enter PERM: 87654321
Enter last name: Doe
Enter first name: John
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: p
********************
CS56: Advanced Applications Programming
Enrolled: 2
	87654321 | Doe, John
	12345678 | Wang, Richert
********************
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: ac
Enter Course Code: CS32
Enter Course Name: Object Oriented Design and Implementation
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: as
Enter course code for Student: CS32
Enter PERM: 55555555
Enter last name: Doe
Enter first name: Jane
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: as
Enter course code for Student: fjdskalf
ERROR: Could not find course.
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: p
********************
CS56: Advanced Applications Programming
Enrolled: 2
	87654321 | Doe, John
	12345678 | Wang, Richert
CS32: Object Oriented Design and Implementation
Enrolled: 1
	55555555 | Doe, Jane
********************
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: ds
Enter course code for Student: CS56
Enter PERM: 8765432
ERROR: Student could not be found.
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: ds
Enter course code for Student: CS56
Enter PERM: 87654321
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: p
********************
CS56: Advanced Applications Programming
Enrolled: 1
	12345678 | Wang, Richert
CS32: Object Oriented Design and Implementation
Enrolled: 1
	55555555 | Doe, Jane
********************
----------
ac: Add Course
dc: Drop Course
as: Add Student
ds: Drop Student
 p: Print ClassRoster
 q: Quit Program
----------
Enter Command: q

Submitting to Gradescope

The lab assignment “Lab03” should appear in your Gradescope dashboard in CMPSC 56. If you haven’t submitted anything for this assignment yet, Gradescope will prompt you to upload your files.

Remember to add your partner to Groups Members for this submission on Gradescope if applicable. Please include both names and PERM numbers for each submitted file. At this point, if you worked in a pair, it is a good idea for both partners to log into Gradescope and check if you can see the uploaded files for Lab03.

For this lab, you will need to upload your source files:

NOTE: Please be sure to ONLY submit these files in order to help our TAs streamline grading. DO NOT include additional files (such as .class files). Also, DO NOT put your files into any subdirectories or define specific packages when submitting your files to Gradescope.:

You either can navigate to your files, “drag-and-drop” them into the “Submit Programming Assignment” window, or use your private GitHub repo to submit your work (if you do this, be sure that your repo ONLY contains the .java files and doesn’t have any .java files in sub directories).

If you already submitted something on Gradescope, it will take you to their “Autograder Results” page. There is a “Resubmit” button on the bottom right that will allow you to update the files for your submission.

Most of the programming assignments for this class will not be autograded in the same way you may have seen in earlier courses. We will use Gradescope mainly as a “dropbox” for all of your assignments. Our staff will manually grade your assignments and assign a score to your submission.

Since Gradescope autograding is disabled, it is very important for you to test and compile your code locally according to the specifications of this lab. As a software developer, it’s an important skill to think of correct functionality and test cases on your own. Be sure to do this before submitting your code to Gradescope. If our staff cannot run your code, then you will receive a 0 for this assignment (and this will not be apparent when submitting your code since Gradescope will not actually compile your code for this assignment).

Your submission will initially have a score of 0.0/100. Don’t worry - this is normal. Once the assignment has been graded by our staff, your actual score will be updated.