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

CPSC 231: Assignment 8 (Worth 6%)

Due Friday April 15

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 'movies.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 the version of the program that you write for this assignment should not have an upper limit on the size of the collection. 

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 feature 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 movie):

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

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

This feature allows the user of the program to display onscreen only movies that meet a specific criteria for one of the six fields.  To fulfill the requirements for this feature you need to implement the 'present movie' feature for only one of the following cases (but you won't get additional marks for implementing more than one case): 

    Rating: The user can type in one of the rating categories (case sensitive)  and your program will display all 
    movies with that rating.

    Genre: The user can type in a genre  (case sensitive) and the program will list all the movies that fall in the 
    genre specified by the user.

    The number of stars received:  The user can type in a numerical value that indicates the 
    minimum acceptable number of stars that a movie must have.  The program will then 
    present only those movies that received the specified number of stars or greater.  

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

Edit the information for a movie 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 indicate to the program which movie that they wish to edit by entering the name of the movie and the program searches for that movie.  If the movie is found in the collection then the user of the program will then be able to re-enter the information for all the fields of that movie one field at a time.

Feature four (Insert a movie 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 movie.  The new movie will then be added to the end of the list.

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

Again, the user must type in the name of the movie in order to indicate which movie 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 movie 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 movie information from the "movies.dat" file.  When the user of the program selects the 'save' option then the program will write the modifications to the "movies.dat" file rather than a separate "modifiedMovies.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 reverse 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 "movies".  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.