Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
instance variables both private:
rating String
this is the rating of the movie, which will either be GPGPG or R
runtime int
this is how long the movie is in minutes
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 to watch a PG movie
a person must be at least to watch an R movie
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