Introduction to Computer Science II by James Tam Return to the course web page

CPSC 233: Assignment 3 (Worth 5%)

 

Due Wednesday October 13

New concepts to be applied for the assignment

  1. Dynamic memory allocation using references and class constructors
  2. Arrays of references
  3. Using code in predefined Java classes (String, Character)

Writing a program to manage a course list

For this assignment you are to write a program that will allow a student to track the number of courses that he or she has taken.  The courses will be stored in an array and the program can track information for up to 100 courses.

Grading for working submission

Basic submission ('C' grade):

    Functional requirements

  1. Initializing the list to some starting default values.

  2. Displaying the list in a presentable form e.g., empty list elements should not be displayed, lists that are very long (say over 5 elements in size) should not be displayed all at once but instead the user should have the ability to see only a portion of the list at a time and then the program will wait for a response from the user (e.g., asking the person to hit return) before displaying any other elements.

  3. A menu of options is displayed onscreen.  Although for this grade level not all options will be working, at the very least the user should be able to display the list and to quit the program.

    Design requirements: You need to implement four classes: Driver, CommandProcessor, CourseTracker, Course:

  1. Class Driver: The starting point of execution in the program (contains the main method).

  2. Class CommandProcessor: The purpose of this class to provide an interface to the user: it shows the available menu options as prompting the user for his or her selection.  Based on the user's  selection, different methods of class CourseTracker will then be invoked by the command processor.

  3. Class CourseTracker: It performs the basic list management functions: initializing and displaying the list onscreen, adding new elements, removing or editing existing elements.  Information about the list of courses will be stored in an array of references.  This array will be an attribute of this class.

  4. Class Course: Tracks the pertinent information about a course: 1) The four character course code (e.g., CPSC)  2) The three digit course number (e.g., 233)  3) The year that course was taken (4 digit integer)  4) The grade received ('A', 'B', 'C', 'D' or 'F').

Extra features (completing all three can yield a grade of 'A+'):

Grading: Non-working submissions

D submissions:

The student has invested considerable time and effort into the assignment, the program does not fulfill any of the above requirements but it does compile.

D- submissions:

The student has invested considerable time and effort into the assignment, the program does not fulfill any of the above requirements and it does not compile.

Other submission requirements

In addition to having fulfill the generic assignment requirements the requirements specific to this assignment include:

1. Good coding style and documentation:  They will play a role in determining your final grade for this assignment.  Your grade can be reduced by a letter step or more (e.g., 'A' to 'A-' for poor programming style such as employing poor naming conventions for identifiers, insufficient documentation, the use of global variables or by not assigning the proper operations and attributes to classes).

2. Include a README file in your submission:  For this assignment your README file must indicate what functions you have completed as well as the grade level that you are aiming for.  This will allow your marker to quickly determine what he or she must look for and speed up the marking process.   For example:

e.g., I completed the "C" level requirements plus:

Total estimated grade = 2.0 + 3 steps = 3.0

3. Assignments (source code and the README file) must be electronically submitted via submit.  In addition a paper print out of the source code must be handed into the assignment drop box for the lab that you are registered in (located on the second floor of the Math Sciences building).  Electronically submitting the assignment allows your marker to run the code in order to quickly determine what features were implemented.  Providing a paper printout makes it easier for your marker to read and flip through your source code.