Computer Science, asked by zwarchief, 7 months ago

In the class FirstRatings, run the method testLoadMovies on the file ratedmoviesfull.csv. Note there are 3143 movies in this file.

How many of the movies include the Comedy genre?

Answers

Answered by liyaqatqureshi87
4

Java, Rating.java, and Rater.java and read in and store information about movies and ratings of movies by different movie

raters to answer simple questions about both movies and ratings.

For this assignment you will be given three starter files.

The class Movie is a Plain Old Java Object (POJO) class for storing the data about one movie. It includes the following items:

Eight private variables to represent information about a movie including:

-id - a String variable representing the IMDB ID of the movie

-title - a String variable for the movie’s title

-year - an integer representing the year

-genres - one String of one or more genres separated by commas

-director - one String of one or more directors of the movie separated by commas

-country - one String of one or more countries the film was made in, separated by commas

-minutes - an integer for the length of the movie

-poster - a String that is a link to an image of the movie poster if one exists, or “N/A” if no poster exists

A constructor with eight parameters to initialize the private variables

Eight getter methods to return the private information such as the method getGenres that returns a String of all the genres for this movie.

A toString method for representing movie information as a String so it can easily be printed.

The class Rating is also a POJO class for storing the data about one rating of an item. It includes

Two private variables to represent information about a rating:

-item - a String description of the item being rated (for this assignment you should use the IMDB ID of the movie being rated)

-value - a double of the actual rating

A constructor with two parameters to initialize the private variables.

Two getter methods getItem and getValue.

A toString method to represent rating information as a String.

A compareTo method to compare this rating with another rating.

The class Rater keeps track of one rater and all their ratings. This class includes:

Two private variables:

-myID - a unique String ID for this rater

-myRatings - an ArrayList of Ratings

A constructor with one parameter of the ID for the rater.

A method addRating that has two parameters, a String named item and a double named rating. A new Rating is created and added to myRatings.

A method getID with no parameters to get the ID of the rater.

A method getRating that has one parameter item. This method returns the double rating of this item if it is in myRatings. Otherwise this method returns -1.

A method numRatings that returns the number of ratings this rater has.

A method getItemsRated that has no parameters. This method returns an ArrayList of Strings representing a list of all the items that have been rated.

---Data files

You’ll use several data files for this project. There are multiple versions of each type of file or different sizes.

In creating recommendations you'll need two data files: one of movies, and one of ratings of these movies by different raters.

First there is a CSV file with movie data, the smallest of which is called ratedmovies_short.csv. The other similar files are larger,

so we have created this small file with just a few entries in it that you can use for testing. Each file of this type has a header row as the first line,

first followed by one line for each movie. Shown below is this shorter file that has six lines, the header line first followed by six movies.

The lines are so long that they are wrapping in this document, each movie line is displayed here in two to three lines. For example the first movie has the IMDB number 0006414,

the name of the movie is “Behind the Screen,” and the movie was made in 1916 in the USA. The genres for this movie are Short, Comedy, and Romance. The director is Charles Chaplin,

and the length of the film is 30 minutes. The last item is a link to a .jpg image of a poster for the movie if one exists, or “N/A” if there is not one.

Answered by CuteBunny21
1

Answer:

Explanation:

Energy flow is the flow of energy through living things within an ecosystem. All living organisms can be organized into producers and consumers, and those producers and consumers can further be organized into a food chain. Each of the levels within the food chain is a trophic level.

Similar questions