Question: Create a class called Movie. It should be a subclass of Production and have the following: 2 instance variables ( both private ) : rating

Create a class called Movie. It should be a subclass of Production and have the following:
2 instance variables (both private):
rating (String)
this is the rating of the movie, which will either be "G","PG","PG-13", or "R"
runtime (int)
this is how long the movie is in minutes
1 constructor
it should have parameters for title, genre, year, rating, and runtime (in that order) and set all the instance variables to their corresponding parameters
Getter methods getRating and getRuntime
isOldEnoughToWatch method
one int parameter (the age of the person who wants to watch the movie)
boolean return value
the method should return true or false based on whether the person is old enough to watch the movie, considering their age and the rating of the movie:
anyone can watch a G or PG movie regardless of how old they are
a person must be at least 13 to watch a PG-13 movie
a person must be at least 17 to watch an R movie

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!