ASSIGNMENT 7 (Due Friday Dec. 6)

by James Tam

Weighting = 6%

Note: Except for parts marked with *New*, the specifications for assignment 7 are similar to the ones described in assignment 6.

Assignment description (Movies! Movies! Movies!)

For this assignment you are to write a Pascal program that allows a person to track a list of their favorite movies.  Each movie will have seven major fields.   Each field except for the field listing the cast of the movie (described below under #2) will reside on it's own line.

  1. Movie name 
  2. Cast
  3. Genre
  4. Rating
  5. Number of stars
  6. Director
  7. Format

1. Movie Name

The name of the movie will be a string up to 80 characters in length.

2. Cast

The cast list will consist of the names of the most well-known stars that acted in the movie and may potentially include the person's first, middle and last name.  You can treat these three names as one continuous string i.e., you can store all the information about a star's name in a single character array.  This cast list will always consist of the name of at least one star and will contain at most the names of five stars.  The maximum length of the name field for each star will be 80 characters.  In the input file the name of each star will reside on a separate line.  After the name of the last star there will be a blank line separating this field from the next field.  

e.g., 1 star listed in the cast field
Bruce Lee 

e.g., 3 stars listed in the cast field
Kevin Costner
Sean Connery
Charles Martin Smith

3. Genre

The genre field describes the category that the movie falls into.  There will be six different categories of movies: action, drama, science fiction, comedy, horror and martial arts.   In the input file, the genre field will consist of a string of up to fifteen characters in length.  For this assignment you can assume that movies will fall into only one of these categories.  You can ignore the cases where a movie can be categorized into more than one genre.

4. Rating

The purpose of the rating system is to suggest or indicate how appropriate the movie is for viewers of different ages rather than as a guide to how *good* or *bad* a movie is.   According to CARA (the Classification and Rating Administration), "...the movie rating system is sponsored by the Motion Picture Association of America and the National Association of Theatre Owners to provide parents with advance information on films, enabling parents to make judgments on movies they want or do not want their children to see."  

There are six different possible types of ratings for a movie: G, PG, PG-13, R, NC-17 and NR.

G (General Audience): All ages admitted.

PG (Parental Guidance Suggested): Some of the subject matter in the movie may not be suitable for children.

PG-13 (Parents Strongly Cautioned):  Some of the subject matter in the movie may not be suitable for children under 13.

R (Restricted): People under the age of 17 (ages may vary by location) require an accompanying parent or adult guardian to view the movie.

NC-17: No one under the age of 17 (again ages may vary by location) will be admitted regardless of who accompanies them. 

NR (Not rated): The movie has not yet been rated.

In the input file, the rating field will reside on a line by itself and it will take the form of a string of up to 5 characters in length ("G", "PG", "PG-13", "R", "NC-17", "NR").

5. Number of stars

This field rates each movie according to how good or bad that I thought it was1.  The greater the number of stars, the better the movie.  In the input file the number of stars that a movie received will be specified by a number from one to five inclusive.

    1 star (It sucks) It's not the type of movie that is so bad that it's good, it's just bad.  Don't  
    waste your time with this one.

    2 stars (Poor) Overall there were more things that I disliked than liked with this movie.   
    Probably one that you should still avoid.

    3 stars (Average)  There were some things that I liked and some things that I disliked.  It's one
     that you may want to rent rather than buy.

    4 stars (Good)  This movie has some flaws but overall you'll have a great time viewing it.

    5 stars (A true masterpiece!)  I laughed, I cried, it became a part of me.  It should definitely 
    be nominated for an Oscar (maybe several).

1. JT: The number of stars given to the movies in the input file was based solely upon my opinion and does not necessarily reflect the opinions of the university so please don't write angry letters outrage to them because you thought I didn't properly rate your favorite flick :-). 

6. Director

The name of the director will be a string up to 80 characters in length.  As was the case with the names of each cast member, the name of the director may include a first, middle and last name but you can store all of this information in a single character array.

7. Format

A movie will be available on DVD, VHS or both.  Information about the format(s) that the movie is available on will be specified on a single line of the input file in one of three possible formats:

DVD   The movie is available only on DVD
VHS   The movie is available only on VHS
DVD VHS   The movie is available on both DVD and VHS

A line of stars will be used in the input file to separate each movie.  This separator is not to be read in as data by your program (don't create another field in order to store the separator line).   

Example movie listing from the movie file.

It's a wonderful life
James Stewart
Donna Reed
Lionel Barrymore
Thomas Mitchell
Henry Travers

Drama
NR
5
Frank Capra
DVD VHS
************
Star Trek - First Contact
Patrick Stewart
Jonathan Frakes
Brent Spiner
LeVar Burton
Michael Dorn

Science Fiction
PG-13
5
Jonathan Frakes
DVD VHS
************
Ultimate Fighter #107: Catbert Vs. Garfield
Catbert
Garfield
Odie
Dilbert
Jon Arbuckle

Martial Arts
NC-17
1
Jim Tam, Ace Director (TM)
VHS
***********

Relevant files (*New*)

The information for the movies is stored in the Unix text file, called "movies".   This file contains a list of 75 movies.  For testing purposes you can use a smaller version of this file called "mini_movies".  In addition, you can run an executable program, called "a6",  that reads the movie list from a file and displays it back to the screen (to provide you with an example output style).  Unlike the case with assignment 6, where your program read the movies into an array of records, your program for assignment 7 is to read in the information for the movies from the file and store it in a linked list   From there you program should be able to perform some basic list management features which are described in the following section, "Assignment grading".

Assignment grading

Make sure you clearly indicate in your README file which grade level that you think you have completed for this assignment.  This should be followed by a list of the features that you have implemented in your program..  As was the case with the previous assignment, failure to provide this information will result in a grade reduction of one letter step e.g., "A" to "A-".

e.g.,  Assignment for James Tam

         "B+" level assignment

        Features completed:

        1) All the requirements of a "C+" level assignment

        2) The ability to find a movie by searching under it's title

        3) The ability to insert a movie into the list

        4) The ability to remove an existing movie from the list

D- version 

The student has invested a considerable effort in the assignment, but the program does not compile.

D version

The student has invested a considerable effort in the assignment, the program compiles but does it not fulfill any of the requirements listed in the assignment specification.

Basic Assignment Submission: C+ level assignment  (*New*):  

Your program reads the information from file into the linked list and you display the contents of the list onscreen with write's and writeln statements.  The output must be displayed in a neat and legible format file (see the example format provided with the sample executable "a6").    Finally your program must be able to write the movie list back to a file called "modified_movies".  In addition,  the assignment must be properly documented and must follow a good programming standard in order to qualify for a "C+" grade. Similar to previous assignments, your program has menu driven interface.  The basic program should display a menu similar to the one shown below:

Movie Collection: Menu options

(D)isplay collection

(L)oad a collection from disk

(S)ave a collection to disk

(Q)uit program

You should add additional menu options as you implement the features listed below.  Although it is recommended that you implement the basic program first, you should keep in mind as you design your "C+ level" how you would augment this program to implement some of the extra features (listed below).  

Extra features (*New*: The sort feature has been removed)

Completion of each of these extra features will result in the increase of a "one step" increase in 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 six features will make you eligible for an A+.   

Feature one (Find additional details about a movie):

The user of the program can type in the name of the movie 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 certain criteria for one of the seven fields.  To fulfill the requirements for this feature you need to implement the Present feature for one of the following cases (but you won't get additional marks for implementing it for more than one case): 

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

    Genre: The user can type in a genre 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.  

Since assignment 7 does not require the implementation of a sort feature, the movies will presented in the order in which they currently appear in the array and not in sorted alphabetical order.

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 which movie that they wish to edit by entering the name of the movie.  When the edit movie feature is selected, the user of the program will then be able to edit all the fields of that movie one field at a time.

Feature four (Insert 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.  It is up you to determine how you want to have your program have the person indicate how many cast members that they wish to input.   Just try to make the process as simple and straight-forward for the user as possible. 

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

Again, since 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, you need have complete the lookup movie feature first (feature one).   

Feature six (Clear the entire list)

This feature allows the user to remove all movies from the list.  

Learning objectives (*New*):

Understanding and applying the following concepts:

1) Dynamic lists  - learning how to declare and use linked lists in Pascal.

2) Common list management operations - this includes common tasks that you might need to complete when dealing with a list of data such as adding new elements to the list, deleting, editing existing elements to the list etc.  However unlike assignment 6, in this case you must learn how to perform these operations with a linked list.

Submitting the assignment

There are two major steps required in the submission of this assignment:

1. Step for the electronic submission 

Use the submit system to electronically submit the source code for your assignment i.e., the file with the dot-p ".p" suffix.  In addition you must  also submit a text file called "README" for your TA.  This file will provide step-by-step instructions for running your program, as well what version of the assignment you have completed and what features have been implemented e.g., the A version, the B version etc.  Since this is a complex assignment with multiple requirements it is crucial that clearly indicate in the README file what version of the assignment that you have completed.   Failing to include this information will result in a grade reduction of one step (e.g., "A" to "A-").  Other information to include in the README includes any special cases or conditions that you may have implemented which are extra to the requirements of the basic assignment.  As was the case with previous assignments, you need to include a set of instructions that describe how to run your program.  These instructions must be clear and complete enough so that your TA will  know how to mark your assignment.  Don't expect your marker to have to decipher cryptic instructions, he or she will only work with the instructions that they were provided with (by you) and grade your assignment accordingly. 

2. Step for the paper submission

Print out the source code for your assignment (print the source code directly rather than running a script and then printing the script) and put the printout into the  appropriate drop box located on the second floor of Math Sciences. 

Suggested Approaches to this Assignment:

1) Start early! As was the case with the fifth assignment, this is another tough assignment.  There's a lot of new concepts that you have to understand and apply in order to complete the assignment requirements.

2) Take it in small steps.  Get the basic program working before you start working on the additional features.  Make sure it really works by testing it!  

3) Back up your work!  Once you get your basic program working make a backup copy (e.g., at Unix type 'cp a7.p a7.basic'.  As you complete additional features backup these versions and don't touch the backup and when you start working on more features modify only the copy.

4) Do attempt this assignment.  Although it isn't worth a large percentage of your final grade, writing these programs really helps you to truly understand the concepts that you were taught in lecture.

5) Addendum to point 4 - while it is important to try this assignment both for the learning and the marks don't fall into the other extreme and spend all your time on these last two assignments worth 12% and no time studying for a final exam worth 40%.

References

Much of the movie information came from the following two web sites:

  1. Amazon: www.amazon.com
  2. The Internet Movie Database: www.imdb.com