Answered step by step
Verified Expert Solution
Link Copied!

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:
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

4. Describe cultural differences that influence perception

Answered: 1 week ago