******** Movie DB ******** * **Worth**: 5% * **DUE**: February 27th, 2024 at 11:55pm; submitted on MOODLE. .. warning:: For this assignment, you may **not** work with anyone else. You need to work independently. 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: .. code-block:: Java // Student name: // Student number: 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". Dataset ------- The dataset is extracted from the official dataset of IMDB. It is composed of two files: * :download:`titles.csv <../asn/movieDB/titles.csv>`: A CSV file with the id of the movie and its title. * :download:`ratings.csv <../asn/movieDB/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. 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. main **** * This file should take two arguments from the console: .. code-block:: Main :code:`Main` is the name of the executable. * Then it should create the class :code:`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". Title ***** * :code:`Title` implements :code:`Comparable`. * It contains to attributes: * :code:`title`. * :code:`ID`. * The comparison must be on the **title**. rating ****** * :code:`Rating` implements :code:`Comparable`. * It contains to attributes: * :code:`ID`. * :code:`rating`. * The comparison must be on the **ID**. 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 :code:`title_db` and :code:`rating_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: * :code:`public double find_rating_movie(String movieName)` * :code:`private void loadMovieFile(String movie_file_name)` * :code:`private void loadRatingFile(String rating_file_name)` * :code:`private Title parseLineMovie(String line)` * :code:`private Rating parseLineRating(String line)` TitleDB ******* * It is an instance of the class :code:`AVLTree` implemented in classe. * It will use the class :code:`Title`. RatingDB ******** * It is an instance of the class :code:`AVLTree` implemented in classe. * It will use the class :code:`Rating`. 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. 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.