Download ratings.tsv. This file contains data for real-world movie ratings. If you click on the the above link, you will see that each line of that file contains three numbers.
We're going to ask some simpler questions.
|
$ ./p1 movie 7 4.03165 user 2 2.4359 quit |
Your program should run, answering queries about movies and users, until the user of your program enters quit.
Don't forget to delete your arrays, and use Valgrind to double-check for memory errors!
Start your program by turning ratings.tsv into a 2D matrix,
which has 610 rows (number of users) and 9724 columns (number of
movies).
You'll then add some more functions to be able to print out the average values of individual movies and users.
~/bin/submit -c=IC210 -p=lab09 p*.cpp
Write a program named p2.cpp that works as follows:
Submit~/bin/submit -c=IC210 -p=lab09 p*.cpp | Sample run (user input in red):
~/$ ./p2 8 Streets, 5 Avenues 0 0 0 0 0 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 3 0 0 > crash 2nd Street, 1 Avenue 0 0 0 0 0 1 0 0 0 0 0 1 0 0 4 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 3 0 0 > crash 7th Street, 4 Avenue 0 0 0 0 0 1 0 0 0 0 0 1 0 0 4 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 3 0 1 > crash 2nd Street, 4 Avenue 0 0 0 0 0 1 0 0 0 0 0 1 0 0 5 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 3 0 1 > quit |