spring 2005
homework assignment #4
due tue may 3, by 6AM (electronic submission)

last updated: Mon Apr 25 19:16:16 EDT 2005 (sklar)
1. default movie rating is 3 (added sun-24-apr)
2. reviews, when stored in the data file, should have the special CGI characters removed (I had left them in the example by mistake-- sorry!) (added sun-24-apr)
3. public movies.dat information added (mon-25-apr-AM)
4. image locations information added (mon-25-apr-PM)

NOTE: There will be NO extensions given on this assignment!!!


assignment description.

This homework assignment is the final part of your four-part homework project. It will be written in C++ and will implement a search for movies and reviews.

NOTE that the description of this assignment is much less detailed than the other assignments for this class. Since this is the last assignment, the hope is that you don't need (or even want) detailed step-by-step instructions, but rather that you have learned enough now to figure out on your own how to design a programming solution and structure your code beautifully :-)

This assignment is worth 10 points. Distribution of points is indicated below. The points are based on the program specifications. Pretend that I am your customer and I gave you these specs. As the programming consultant, you have to fulfill them in order to get paid!




  1. Include a timesheet (0.5 points)

    Download the timesheet and fill in predictions of how long it will take you to do each task associated with this assignment. Then, as you are working on the assignment, keep track of how long it actually takes you.

    You will not lose points for the values you put on this timesheet. It is for your benefit -- so you can see how long you think it will take you to do things, and how long it really takes you. You will not be marked on the content of the timesheet -- only that you have completed and submitted it.


  2. Include a makefile. (0.5 points)

    Your entire assignment should be built using a makefile. The makefile must include rules to build all the C-based and C++-based CGI programs, even the ones from the previous 3 homeworks. The TA should be able to build your assignment just by typing make from the UNIX command line ON CLUSTER.CS.COLUMBIA.EDU (i.e., have an all target).
    You should also have a clean target, like last time.


  3. Update your site map and programmer documentation (1 point)

    Update the site map in your README file (from hw3) to illustrate how you are fitting any new functionalities into your site.
    Make sure to also include information on any known bugs or special features of your code.


  4. Include a search option on the main menu (1 point)

    Modify your site home page so that there's a top-level option to search the movies database. You have to decide if anyone gets to search the database or only users who are logged in. Of course, only users who are logged in can enter movie reviews...
    Clicking on the top-level search option should send the user to a search web page that activates the two types of searches described below. Create the search web page and allow the user to select either type of search.


  5. Implement search by title (3 points)

    Write a C++ program to allow the user to search the movies database by title. Note that because of the way the assignments have been designed, multiple people may have the same movie title in their individual movies.dat files, so when we use the combined database, there might be entries with different unique ID numbers but the same movie title. Your search should turn up a list of all the movies with the same title.

    The merged movies.dat file is located here: /home/cs3157/public/movies.dat
    You MUST use this file so modify your code so that you are picking this up using the COMPLETE PATH REFERENCE (as opposed to the relative referencing you're doing for the rest of your code).

    I want to be able to click on each movie title in the search results list and see a page containing the movie's database entry (title, image, director, cast, etc., plus reviews). Users should be able to see and enter reviews from this page (if they are logged in).


  6. Implement search by rating (3 points)

    FIRST, modify the review capability from hw3 to include an additional field called RATING. The RATING should go from 1..5:

    • 5 = best movie ever!
    • 4 = pretty good
    • 3 = fair
    • 2 = not so good
    • 1 = big turkey
    Make the default rating be 3.
    For example, the review data file would now contain entries looking like this:
    REVIEW=great movie!!!
    This will involve changing some of the C code from last time.
    ALSO note that any special CGI characters are removed from the review before it is stored!

    SECOND, allow the user to search your reviews database for all movies that match a certain rating (1..5). As above, the search results should turn up a clickable list of movie titles. I want to be able to click on each movie title in the search results list and see a page containing the movie's database entry (title, image, director, cast, etc., plus reviews). Users should be able to see and enter reviews from this page (if they are logged in).


  7. DEMO your project to me or a TA on Wednesday May 4 (1 point)

    During the final exam on Monday May 2, you will be able to sign up for a 15-minute demo slot for Wednesday May 4. On Wed, you'll come to the CLIC lab during that time slot and show your SUBMITTED project to me or one of the TAs. Successful demos are worth 1 point each!


  8. submit.

    You need to submit your homework electronically :-) Make sure that you have followed the file naming specifications listed above (case included!) Failure to follow do so will result in 10% off the assignment grade -- ouch!

    You need to submit the whole project -- the makefile, all C and C++ source and header files, the README file, any data and image and html and perl/cgi files. IT IS UP TO YOU TO MAKE SURE THAT EVERYTHING NEEDED TO RUN THE WHOLE PROJECT GETS SUBMITTED! Your demo will be run using the code that is SUBMITTED!!! NOT the code that is on your web site and/or home directory.

    • Log in to a CS cluster machine by running:
      bash# ssh cluster.cs.columbia.edu

    • From your hw4 working directory (on cluster), run the submit-hw script:
      bash# ~cs3157/bin/submit-hw 4

    • Answer the script's questions as they come up. You will receive an email shortly after the script is done running --- on your CS account!