2. Movie DB
Worth: 5%
DUE: March 1st, 2023 at 11:55pm; submitted on MOODLE.
Warning
For this assignment, you may not work with anyone else.
You need to work independently.
2.1. How to submit your work
You need to submit your Java files directly on moodle. The first two lines of the Java file should be as follows:
// Student name:
// Student number:
2.2. Instructions
In this assignment you implement a simple database of movies.
The database will allow the user to enter a movie name.
Your program should print the IMDB rating for the movie.
The program stop when the enter “quit”.
2.2.1. Dataset
The dataset is extracted from the official dataset of IMDB.
It is composed of two files:
titles.csv
: A CSV file with the id of the movie and its title.ratings.csv
: A CSV file with the id of the movie and its rating.
You need to download the files.
Important
Not all movie has a rating. You will need to handle this case.
2.2.2. Structure of your program
The program should contain the following files:
Main
MovieDB : It’s the main class of the program, it contains the two sub-databases
Title : The class that will contain only the id and the title of the movie.
Rating : The class that will contain only the id and the rating of the movie.
2.2.2.1. main
This file should take two arguments from the console:
Main <titleDB_file_name> <ratingDB_file_name>
Main
is the name of the executable.
Then it should create the class
MovieDB
.Then it ask the user to enter a movie name.
If the movie exist it returns the rating and ask a new movie.
Otherwise, it print a message saying that this movie doesn’t exist and ask a new movie.
Finally, the program ends when the user type “quit”.
2.2.2.2. Title
Title
implementsComparable
.It contains to attributes:
title
.ID
.
The comparison must be on the title.
2.2.2.3. rating
Rating
implementsComparable
.It contains to attributes:
ID
.rating
.
The comparison must be on the ID.
2.2.2.4. MovieDB
The principal class of your program.
The constructor should take the two files in argument.
With the DB files it should instantiate the two classes
title_db
andrating_db
.It should have a method taking the movie name entered by the user and make the correct request to obtain the rating of the movie.
Concretely, it should contains the methods:
public double find_rating_movie(String movieName)
private void loadMovieFile(String movie_file_name)
private void loadRatingFile(String rating_file_name)
private Title parseLineMovie(String line)
private Rating parseLineRating(String line)
2.2.2.5. TitleDB
It is an instance of the class
AVLTree
implemented in classe.It will use the class
Title
.
2.2.2.6. RatingDB
It is an instance of the class
AVLTree
implemented in classe.It will use the class
Rating
.
2.3. Some marking details
Warning
Having the correct outputs doesn’t mean that you will obtain a perfect mark.
The marking will depend on:
Correctness.
Comments
Variable names
Style
etc.
2.4. General FAQ:
- Does my text file have enough details?
Probably. The shorter the better.
- Do I have enough comments?
I don’t know, maybe? If you’re looking at code and have to ask if you should comment it… just comment it. That said, don’t write me a book.
- Can I work with my friend?
No.
- If our code/functions are identical, you won’t really call this cheating, would you?
Yes.
- Moodle was totally broken, it’s not my fault it’s late.
Nice try.
- I accidentally submitted the wrong code. Here is the right code, but it’s late. But you can see that I submitted the wrong code on time! You’ll still accept it, right?
No.