Menu

[solved]-12 20 Points Given Movie Class Representing Movie Ranking Public Class Movie Private Int S Q39001436

12. (20 points) Given the Movie class representing a Movie and its ranking: public class Movie { private int stars ; public M12. (20 points) Given the Movie class representing a Movie and its ranking: public class Movie { private int stars ; public Movie (int stars) { this. stars=stars ; } public void setStars (int £) { stars f; public int getStars () { return stars; Write ONLY the constructor for a class MovieTheatre that has two attributes: – MovieList, an array of Movie objects showing in the theater -rankings, an array of integers containing the number of movies in each star category, 0-5, inclusive The constructor takes an integer parameter named size representing the library’s size. It initializes all the elements of the array to Movie objects with stars value a random number between 0 and 5, inclusive and populates the rankings array accordingly. For example, if the movie theatre is showing: Movie 1 -3 stars Movie 2-3 stars Movie 3-5 stars Movie 4-2 stars The rankings array will contain 1, 0, 2, 1, 0,0 Show transcribed image text 12. (20 points) Given the Movie class representing a Movie and its ranking: public class Movie { private int stars ; public Movie (int stars) { this. stars=stars ; } public void setStars (int £) { stars f; public int getStars () { return stars; Write ONLY the constructor for a class MovieTheatre that has two attributes: – MovieList, an array of Movie objects showing in the theater -rankings, an array of integers containing the number of movies in each star category, 0-5, inclusive The constructor takes an integer parameter named size representing the library’s size. It initializes all the elements of the array to Movie objects with stars value a random number between 0 and 5, inclusive and populates the rankings array accordingly. For example, if the movie theatre is showing: Movie 1 -3 stars Movie 2-3 stars Movie 3-5 stars Movie 4-2 stars The rankings array will contain 1, 0, 2, 1, 0,0

Expert Answer


Answer to 12. (20 points) Given the Movie class representing a Movie and its ranking: public class Movie { private int stars ; pub… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *