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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 3 Lnai 9853

Authors: Bettina Berendt ,Bjorn Bringmann ,Elisa Fromont ,Gemma Garriga ,Pauli Miettinen ,Nikolaj Tatti ,Volker Tresp

1st Edition

3319461303, 978-3319461304

More Books

Students also viewed these Databases questions

Question

Write a paper on Career Trends and 21st Century Skills

Answered: 1 week ago

Question

Identify the types of informal reports.

Answered: 1 week ago

Question

Write messages that are used for the various stages of collection.

Answered: 1 week ago