Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 2 The class Movie is started below. An instance of class Movie represents a film. This class has the following three class variables: .title,

image text in transcribed
Exercise 2 The class Movie is started below. An instance of class Movie represents a film. This class has the following three class variables: .title, which is a String representing the title of the movie studio, which is a String representing the studio that made the movie rating, which is a String representing the rating of the movie (i.e. PG13, R, etc) * PG: Parental guidance, R: Restricted.... public class Movie private String title: private String studio: private String rating: // your code goes here > a) Write a constructor for the class Movie, which takes a String representing the title of the movie, a String representing the studio, and a String representing the rating as its arguments, and sets the respective class variables to these values. b) Write a second constructor for the class Movie, which takes a String representing the title of the movie and a String representing the studio as its arguments, and sets the respective class variables to these values, while the class variable rating is set to "PG". c) Write a method getPG, which takes an array of base type Movie as its argument, and returns a new array of only those movies in the input array with a rating of "PG". You may assume the input array is full of Movie instances. The returned array need not be full. d) Write a piece of code that creates an instance of the class Movie with the title "Casino Royale", the studio "Eon Productions", and the rating "PG13

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

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

=+6 Who is the peer of the IA ?

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago