Homework 4
Due Tuesday, March 25th, 2003 at 11:59:59pm EST
The FAQ has been started.
You are to create a movie repository, similar in concept to the
ever-popular Internet Movie Database. This program will store
information about a variety of user-entered films. At a minimum, each
film must have:
- A title
- A director
- One or more actors (no limit on how many)
- A release date (just the year is fine)
- A genre
- A plot summary
If your program is run with a command line argument, you must first
open the file specified on the command line, parse it, and store all
movies listed into your system. The file will be formatted according
to your own specifications (See Save & Exit below).
Your program will implement a menuing system to continually ask the
user to make a choice. Valid choices on your menu are:
- Add a new movie
- Search for movies
- Print a movie's info
- Print all movies
- Remove a movie
- Edit a movie's description
- Save and Exit
- Exit without Saving
For this assignment, I am making two structural requirements in your
program. The first requirement is that each of the above menu items
must be contained within its own user subroutine. The second
requirement is that within your program you must make good use of at
least one mulit-dimensional structure (ie, array of arrays, array of
hashes, hash of arrays, hash of hashes of arrays of arays of hashes of
arrays, etc).
If you choose you may write your own class as part of this
assignment. If you do use an object oriented aproach to this program,
the object can count as one dimension in your multi-dimensional
structure.
Following is a description of each user subroutine:
Add a new movie
When the user selects this option, you must prompt the user for each
of the pieces of information, one at a time. (title, director, list of
actors, release date, genre, plot summary).
Be sure your prompt specifies how the actors are being read in.
(Seperated by commas, newlines, etc)
Search for movies
When the user selects this option, you prompt the user to search by
actor, director, or genre. The user selects one of those options, and
you then prompt for a search term. When the user enters the search term, you
print out a list of all titles of movies that match (case insensitive).
Print a movie's info
Prompt the user for a movie's title, and then print out all of that
movie's information (title, director, list of actors, release date,
genre, and plot summary).
Print all movies
First ask the user whether to sort by title or by release year. Then
print out all movie titles and release years, correctly sorted
(Alphabetically for title, or ascending numerically for release year).
Remove a movie
Ask the user for a title, and remove all of that movie's information
from the system.
Edit a movie's description
Ask the user for a title, and then take in a new plot summary for that
movie. All other information should remain the same.
Save and Exit
Write the current system to a data file. If the program was started
with a filename on the command line, write the data back to that file
(over-writing the previous contents). If not (ie, the system was
blank when the program was started), prompt for a file name and write
to that file. Then exit the program
Exit without saving
Simply exit the program without writing the current system to a data
file.
Grading Criteria
| Add a new movie | 10 |
| Search for movies | 20 |
| Print a movie's info | 10 |
| Print all movies | 15 |
| Remove a movie | 5 |
| Edit a movie's description | 5 |
| Save and Exit | 10 |
| Exit without Saving | 5 |
| Compilation | 5 |
| Error Checking | 5 |
| Code Style | 5 |
| Output Style | 5 |
Additionally, there will be a 20 point penalty if either structural
requirement is not met (40 point penalty if neither is met)
Because there are so many ways to extend this program, the Above &
Beyond option is raised to a maximum of 10 points.
Submission Instructions
You may again use either ~lallip/public/submit.pl or the
submission script. If you choose to write your own class, and
therefore have multiple files to submit, you MUST zip (or gzip)
the files and submit only the zipped file. The file you submit must
have either a .zip or a .tar.gz extention.
Note: (3/19/2003) Both submission scripts now support
multiple files for HW4
submission. Please note the following important caveats: If you have
more than one file to submit, you MUST either compress them into a zip
file (using either Unix's zip or any standard Windows
zipping program), or create a tarball using Unix's tar and gzip.
ONLY files ending with .zip or
.tar.gz (case sensitive!) will be accepted in this
manner. Any other file will be treated as plaintext and will
therefore likely not be submitted properly.
If you have any questions, PLEASE ask. And if you note any problems
with the submission scripts, please let me know ASAP.
As always, the program must run correctly on
rcs-sun1.rpi.edu