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

CPSC 231: Assignment 8 (Worth 6%)

New concepts to be applied in this assignment

  1. Dynamic (linked) lists

Assignment description

Unless otherwise specified, the requirements for this assignment are the same as ones for the previous assignment.

Grades for working assignments:

Basic assignment: C+

Unlike the previous assignment, the base level assignment grade begins at a 'C+' rather than a 'C'.  Another difference is that your program reads the information from the input file 'sites.dat'  into a linked list rather than an array.  This means that when you implement 'extra' features four and five, the number of elements in the list will actually change (and not just the number of elements of the list that are actually used).  Also this means that your program should not have an upper limit on the size of the list. 

Extra features: 

Completion of each of these extra features will result in the increase of a "one step" to your grade e.g., 'C+' to 'B-'.  Except for features one, three and five you can complete as many of the features below as you wish in whatever combination that you desire.   In the case of those three features you must have completed feature one before you can get credit for features three or five.   Successful completion of all seven features will make you eligible for an A++ (which is recorded as a grade of '4.6' in the grade book).   As was the case with previous assignments you must also fulfill style requirement as well as the general submission assignment requirements.

Feature one (Find additional details about a site):

The user of the program can type in the name of the site (case sensitive) to find additional information about that site .  If the site is not in the list, then your program should indicate that the site could not be found under that name.  If the site is in the list, then your program will display additional details about that site (all the fields of that site will be displayed onscreen).

Feature two (Present all sites that meet a certain criteria):

This feature allows the user of the program to display onscreen only sites that meet a specific criteria for the 'vacation type' field.  The user can type in one of the rating categories and your program will display all the places which are categorized under that type of vacation.

Feature three (Edit site information - requires that you have already completed feature one):

Edit the information for a site in the list.  In order to complete the requirements for this feature you must have completed feature one because the user of the program must enter the name of the site to be changed.  If site cannot be found in the list then the program will display a suitable error message..

Feature four (Insert a site at the end of the list):

When this feature is selected by the user, he or she will prompted to enter in information for all the fields of the new site.  If the information for the site has not yet been entered (your program can check by comparing the name against the names in the list), the new site will then be added to the end of the list.  Otherwise a suitable error message will be displayed to the user.

Feature five (Remove a site from the list - requires that you have already completed feature number one):

Again, the user must type in the name of the site in order to indicate which site that he or she wishes to remove from the list so you need have completed the lookup contact feature first (feature one).  When the collection is displayed, no information about the deleted site should be displayed - not even blank spaces.  Unlike the previous assignment, you won't have to worry about shifting array elements but instead you should implement this feature by reassigning the list pointers (but don't forget to de-allocate the memory for the deleted element!). 

Feature six (Write an enhanced Save feature):

In order to get credit for this feature, the program will now use only one data file.  The program will load the information from the "sites.dat" file.  When the user of the program selects the 'save' option then the program will write the modifications to the "sites.dat" file rather than a separate "modifiedSites.dat" file.  To get credit for this feature your program must be also be able to reload the updated information after it has been written to a file.  This latter requirement means that your program must write the information to disk in the exact same format that it was originally stored.  If there any differences between the original data file and the modified version, your program will not be able to properly read it back into the list.

Feature seven (Display the list in opposite order):

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) 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 which is displayed last.  Because this features is a 'bonus' (JT: actually it's 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 in 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.

Grades for non-functional assignments

D level assignment

The student has invested considerable work in the assignment and the code compiles but it doesn't fulfill any of the above requirements.

D- level assignment

The student has invested considerable work in the assignment but it doesn't compile.

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 if your submission was implemented using bad style conventions (e.g., 'A' to 'A-' for employing poor naming conventions for identifiers, insufficient documentation, the use of global variables, using non-modular design or having an excessively large amount of redundant code in your program).

  2. Include a README file in your submission:  For this assignment your README file must indicate what grade level that you think your assignment should receive (e.g., 'A', 'B' or 'C') and the features that you have implemented.  This will allow your marker to quickly determine what he or she must look for and speed up the marking process.

  3. Assignments (source code/dot-p files 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 for the tutorial 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.

Relevant Files

In the directory for this assignment you will be able to run a sample executable called "sites".  As was the case with the previous assignment, I've disabled feature #6 for the version in the assignment directory.  Also, the program that you submit to your marker must be able to run properly with the full data file.