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

CPSC 231: Assignment 9 (Worth 8%)

 

New Concepts to be applied for the assignment

  1. Dynamic (linked) lists.

 

Assignment description

Unless otherwise specified, the requirements for this assignment are identical to the ones described in the previous assignment.

Grading: Working submissions

Features of assignments that receive a 'C+':

Your program reads the information from the input file 'courses.dat'  into a linked list (rather than a fixed size array as you did with the previous assignment).  This means that your program should not have an arbitrary limit on the size of the list.  In all other respects this of this assignment should include all the features of the "C+ version" of the previous assignment (display, load, save and quit).

Missing the features of the base assignment:  You have the potential to receive a maximum grade of 'C+' if you implement all of the above features.  If features are missed or improperly implemented then your mark may be reduced by a letter step for each feature that is missed (down to a minimum grade of a 'D' assuming of course that it actually compiles):

  1. Program does not display the list onscreen in a neat and presentable fashion.
  2. Program cannot write the list information to a file (e.g., grades must be written back to the output file in real number format).
  3. The user cannot quit the program.
  4. The user cannot specify the names of the input and output file at runtime (i.e., the file names are the same each time that the program is run).
  5. Program does not detect and display an appropriate message when an empty file is opened.
  6. Grade points are not displayed in a (neat) real number format.
  7. The list puts a limit on the maximum number of courses that can be tracked in memory.

Extra features:

Completion of each of these extra features (save for feature four which is worth two letter steps) will result in the increase of a "one step" to your grade e.g., 'C+' to 'B-'.  Unless there is a compelling reason to do otherwise you may complete as many of the features below as you wish in whatever combination that you desire.  Successful completion of all six features will make you eligible for an 'A++' (GPA = 4.6!).   (You must also fulfill style requirements as well as the general submission assignment requirements

Feature one (Display the list in Opposite order - this first feature replaces the sorting feature from the previous assignment)

In order to receive credit for this feature you cannot use doubly linked lists (don't worry if you don't know what I am referring to because this topic will covered in a later course: CPSC 331) but instead you must use a recursive function or procedure call to display the list in reverse order.  That is, the last element is displayed first, the second last element is displayed second until the first element is reached and it is displayed last.  Because this features is a 'bonus' (actually a bonus on top of a bonus) you may have to do some extra reading to in order to sufficiently understand recursion to implement it for this assignment.  Consequently I recommend that you work on this feature last, after you've gotten all the other features working because it will likely take up substantially more time than everything else.   (JT:  Hint  completing this feature depends upon your ability think and trace code in a backwards fashion).

Feature two (Find additional details about a course):

This feature is identical to feature two in Assignment 8.

Feature three (Present all courses that meet a certain criteria):

This feature is identical to feature three in Assignment 8.

Feature four (Insert a new course):

In a similar fashion to feature four in Assignment 8, your program will perform an in-order insert of a new course into the list except that there isn't a maximum size for the list and there shouldn't be any need to shift elements.  Again your program must check for duplicates and the validity of the grade point.  (JT: This a fairly challenging feature because your program has to handle a fair number of conditions so you might want to wait until the end near before trying to complete it).

Feature five (Remove a course from the list):

This feature is similar to feature five from Assignment 8 except that there shouldn't be any need to shift elements.

Feature six (Write an enhanced Save feature)

This feature is identical to feature six in Assignment 8.

Note: The user should not be able to invoke features one, two, three, five and six when the list is empty.  If the operation is invoked then an error message should be displayed.

Grading: Non-working submissions

D submissions:

D- submissions:

 

Other submission requirements

  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 or the use of global variables other than the debugging variable or variables).  For additional details see the marking guide for coding style.
  2. Assignments (source code/'dot-p' file and the README file) must be electronically submitted via submit.  In addition a paper print out of the source code and README must be handed into the assignment drop box (located on the second floor of the Math Sciences building) for the tutorial that you are registered in.  Your README file must indicate what grade level has been completed (e.g., 'A') and which features have been implemented.   Also you should include your contact information: your name, university identification number and UNIX login name so that your marker knows whose assignment that he or she is marking.  Omitting the necessary information from this file will result in the loss of a letter 'step' (assuming that the marker can actually figure out who the assignment belongs to).  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.  Omitting the paper printout of your program will result in the loss of a letter 'step'.  Omitting the electronic submission of your program will only allow you to receive a maximum grade of D-.
  3. As a reminder, you are not allowed to work in groups for this class.   Copying the work of another student will be regarded as academic misconduct (cheating).  For additional details about what is and is not okay for this class please refer to the following link.

 

Relevant files

You can run a sample executable called 'courses' which can be found in the UNIX directory:  /home/231/assignments/assignment9.  In addition there is a data file that your TA's will use when they are marking your program called 'courses.dat'.

1 What does and doesn't constitute a sufficient amount of time and effort?  It's a judgment call on the part of your marker.  More often than not if you put in a reasonable amount of effort into your assignment and for some reason you just couldn't get it to work then you will receive some credit for your work.   An example of when you wouldn't receive credit is when you simply handed someone else's work.  This latter case assumes that you properly cited the other person's work, if you didn't cite your source and tried to claim that it was your own work then it would be an example of academic misconduct (cheating).