Question
Create a new Java project called L5 and import RottenTomatoes-starter.jar. - https://www.cs.colostate.edu/~cs165/.Spring18/recitations/L5/archive/RottenTomatoes-starter.jar Data The data for this assignment was collected and reformatted from the following
Create a new Java project called L5 and import RottenTomatoes-starter.jar. - https://www.cs.colostate.edu/~cs165/.Spring18/recitations/L5/archive/RottenTomatoes-starter.jar
Data
The data for this assignment was collected and reformatted from the following website. If you are interested, the provided readme has a description of the data formats and some additional information.
Description
You will be creating a MovieLibrary to store information from over 10,000 movies. Each Movie instance will store basic information, RottenTomato ratings, and list of keywords that describe the movie. Once created, you will create methods to filter given specific conditions and format the output.
The KeyWord Class
This class consists of a descriptive word and the frequency that word appears.
The completed KeyWord class has been provided to serve as a template for other classes.
Java specifies that member/instance variables are called fields. The KeyWord class has the following fields:
A private String to store the keyword
A private int to store the frequency
Use the javadoc to understand the KeyWord class. Use the code in the main method to test your class.
The Rating Class
This is a class where ratings from RottenTomato are stored.
Declare the following fields:
A private double to store the average critic score
A private int to store the number of critics in the critic score
A private double to store the average audience score
A private int to store the number of people included in the audience score
Use the javadoc to declare and implement the rest of the methods.
Once you are finished, use the code in the main method to test your class.
The Movie Class
This class creates a Movie object. A Movie object requires a title, year, and list of actors. A Movie object can also have a list of genres, a Rating, and a list of KeyWords.
Declare the following fields:
A private final String to store the title of the movie
A private final int to store the year
A private final List
A private List
A private Rating to store the movie rating
A private List
You will construct an equals method for this class. Read these additional notes before implementation.
Use the javadoc to declare and implement the rest of the methods. Once you are finished, use the code in the main method to test your class.
The MovieLibrary Class
This is where the Movie objects are stored.
Declare the following fields:
a private List
Use the javadoc to declare and implement the rest of the methods.
Once you have finished implementing the code, uncomment the first two lines in in the main method of your MovieLibrary class which:
Create an instance of FileParser.
Create an instance MovieLibrary using the return value of the getAllMovies in the FileParser class. Use the following file names for the arguments:
"resources/movie_titles.dat" "resources/movie_years.dat" "resources/movie_actors.dat" "resources/movie_genres.dat" "resources/keywords.dat" "resources/movie_keywords.dat" "resources/movie_ratings.dat"
Find the questions below in the main method of your MovieLibrary class. Answer each question and supplement the answer with the code you used.
System.out.println("The MovieLibrary class:"); // 1. How many movies are there in total? // Notice that the scores in the Ratings class are integers from 0 to 100, inclusive. // 2. How many movies did the audience rate 95% or above? // Hint: check for movies that score 95 or above // 3. How many movies did the critics rate 0% to 5%, inclusive? // 4. Some movies don't have KeyWords. Explain how you could change // the getDescription method to only print movies that have keywords. // 5. How would you sort the KeyWords by frequency? What class/classes would you modify? // How would you deal with keywords that have the same frequency?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started