Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Language is Java Write a class called Movie.java with the following variables, constructor and methods. Variables: All variables given below must be declared as private
Language is Java
Write a class called Movie.java with the following variables, constructor and methods. Variables: All variables given below must be declared as private except the director variable. director is a string value indicating the director of the movie. name is a string value indicating the name of the movie. release Year is an integer value indicating the year in which movie was released. duration OfMovie is an integer value indicating the duration of the movie in minute. budget is a double value indicating the budget of the movie in million. genre is a boolean value indicating if the genre of the movie is Comedy (true) or Action (false) . Constructor: Write a constructor which gets director of the movie as parameter and sets the related variable. Methods: First, write get and set methods for private variables. readinformation reads user inputs as in the sample output given below and assigns them to related variables. Name: The Matrix Release Year: 1999 Duration of Movie: 136 Budget: 63.5 Genre (Comedy/Action): Action predictAmountOfRevenue gets an integer value (1 for American director or 2 for Australian director) as parameter and predicts the revenue of movies according to the equations below. Finally, it prints the result as given in sample output given below. The revenue of this movie could be 428336500.00 dollars. AmericanAmount = (duration OfMovie - 10000) . (ageOf Movie - 20) - budget - 1000 Also, add 10000 to this revenue if genre of the movie is Action. AustralianAmount = (duration OfMovie 10000) * (ageOf Movie - 15) - budget + 1000 Also, subtract 1000 from this revenue if genre of the movie is Comedy. printinformation prints information as given in sample output. (If genre is Action, you should write "action movie", otherwise you should write comedy movie.) "The Matrix" is a(n) action movie released in 1999 by The Wachowski Brothers. 136 minutes long movie had budget 63.5 million dollars. areMoviesEqual gets one Movie object as parameter and compares two movies in terms of their name, release Year, durationOfMovie, budget and genre variables. Finally, it returns a boolean value indicating whether all are same or not. Write a class called Movie Test.java using main method. Create two Movie objects with the directors The Wachowski Brothers and Peter Weir, respectively. Set features of the first movie as follows by using set methods. Name: The Matrix Release Year: 1999 Duration of Movie: 136 Budget: 63.5 Genre (Comedy/Action): Action Print information of the first movie by using printInformation method. Calculate what was the revenue of the movie by using predictAmountOfRevenue method. (Notice that The Wachowski Brothers is an American director.) . Read information of the second movie by using readinformation method. Print information of the second movie by using printinformation method. Calculate what was the revenue of the movie by using predictAmountOfRevenue method (Notice that Peter Weir is an Australian director.) Compare the two movies by using areMoviesEqual method and print result as given in sample output You need to fill in these classes. Analyze sample outputs given below and write your codes accordingly. Sample Outputs: "The Matrix" is a(n) action movie released in 1999 by The Wachowski Brothers. 136 minutes long movie had budget 63.5 million dollars. The revenue of this movie could be 428336500.00 dollars. Enter information of second movie: Name: The Truman Show Release year: 1998 Duration of Movie: 103 Budget: 60.1 Genre (Comedy/Action): Comedy "The Truman Show" is a(n) comedy movie released in 1998 by Peter Weir. 103 minutes long movie had budget 60.1 million dollars. The revenue of this movie could be 453139990.00 dollars. These movies do not have same features. "The Matrix" is a(n) action movie released in 1999 by The Wachowski Brothers. 136 minutes long movie had budget 63.5 million dollars. The revenue of this movie could be 428336500.00 dollars. Enter information of second movie: Name: The Matrix Release year: 1999 Duration of Movie: 136 Budget: 63.5 Genre (Comedy/Action): Action "The Matrix" is a(n) action movie released in 1999 by The Wachowski Brothers. 136 minutes long movie had budget 63.5 million dollars. The revenue of this movie could be 571146500.00 dollars. These movies have same featuresStep 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