Java

Question
Consider a class Movie that contains information about a movie. The class the following attributes:

The movie name
The MPAA rating (eg. G,PG,PG-13, R)
The number of people who have rated this movie as a 1 (Bad)
The number of people who have rated this movie as a 2 (OK)
The number of people who have rated this movie as a 3 (Good)
The number of people who have rated this movie as a 4 (Great)
Implement the class with all the methods you think is required as accessor and mutators. Write a method add rating that takes an integer as an input parameter and increment by one the number of people rating the movie that matches the input parameter. For example, if 3 is the input parameter, then the number of people who rated the movie as a 3 should increment by one. Write another method getAverage that returns the average value for all the movie ratings. There should be a one method display, which shows the movie name, MPAA rating, and average rating for each movie.

Test this class by writing a main method that creates at least two movie objects, adds at least five rating for each movie, and displays the movie information.

Order from us and get better grades. We are the service you have been looking for.