(Solved) : 1 Create Interactive Java Application Implements Class Called Movie Class Derived Movie Ca Q27078492 . . .
1. Create an interactive Java application that implements aclass called Movie, a class derived from Movie
called AwardWinningMovie, and a driver to demonstrate thefunctionality of the two classes.
Implementation specifics are described below. As usual, yourprogram output should resemble the
sample runs at the end of this document.
Implementation Requirements:
Part 1. Create a superclass called Movie that represents a movie.Required attributes include title,
rating, genre, director, and star. For example, an object of typeMovie called starTrekMovie
could have attributes Star Trek into Darkness (title), PG-13(rating), Sci-fi (genre), J.J. Abrams
(director), and Chris Pine (star). Implement the Movie classaccording to the following
specification:
Five private instance variables that represent title (typeString), rating (type String), genre
(type String), director (type String), and star (typeString).
A five-argument constructor that initializes the five instancevariables.
set and get methods for each of the five instancevariables.
An equals method that compares two Movie objects for equality andreturns a boolean value.
A toString method that generates nicely formatted output of theMovie attributes. (Note: Your
toString method must override the toString method of classObject.)
Part 2. Create a subclass of Movie called AwardWinningMovie withtwo additional attributes,
award title and award year. For example, Star Trek into Darknesswon the ASCAP Award for Top
Box Office Films (award title) in 2014 (award year).) Implement theAwardWinningMovie class
according to the following specification:
Private instance variables awardTitle (type String) and awardYear(type int).
A seven-argument constructor that initializes the seven instancevariables. (Hint: Start by using
the superclass constructor to initialize the inherited instancevariables.)
set and get methods for each of the two additional instancevariables.
An equals method that compares two AwardWinningMovie objects forequality and returns a
boolean value.
A toString method that generates nicely formatted output of allof the AwardWinningMovie
attributes.
Part 3. Create an interactive driver to test your program. Thedriver begins by creating a database of
a minimum of 10 AwardWinningMovie objects. (Implement the databaseusing an array or an
ArrayList.) It then provides the user with two options: display theaward-winning movies
alphabetically by title, or display the award-winning moviesalphabetically by genre. Next, it
prompts the user to select a movie to obtain more informationabout. Please note that the driver must
validate the user’s input. Specifically, it must use exceptionhandling (try-catch block) in
combination with one or more loops to deal with the possible entryof non-integer values as well as
the entry of out-of-range values. Once the input has beenvalidated, the driver displays the requested
information about the movie. Finally, the driver asks the user ifs/he would like to obtain information
about another movie. If the user enters “Y,” the program continues;otherwise, it thanks the user for
using the experimental database and ends.
Implement a search option. Specifically, provide the user withthe option to
search the experimental database by one of the AwardWinningMovieattributes (title, genre,
star, etc.)
Sample run #1:
run:
EXPERIMENTAL AWARD-WINNING MOVIE DATABASE*
—————————————–
(*Funded in part by IMDb.com)
Movie titles are displayed alphabetically by default.
To display them alphabetically by genre, type G at theprompt.
Otherwise, simply press <Enter>.
Your preference?
Selected award-winning movies:
1) Contact
2) Driving Miss Daisy
3) Forrest Gump
4) La La Land
5) Raiders of the Lost Ark
6) Sophie’s Choice
7) Star Trek Into Darkness
8) The Queen
9) Titanic
10) X-Men
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please enter the number of the movie you would like to know moreabout: 8
Title: The Queen
Rating: PG-13
Genre: Biography
Director: Stephen Frears
Star: Helen Mirren
Award: Oscar for Best Performance by an Actress in a Leading Role,2007
Inquire about another movie (Y/N)? y
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please enter the number of the movie you would like to know moreabout: five
Movie choice must be an integer. Please try again.
Exception: java.util.InputMismatchException
Please enter the number of the movie you would like to know moreabout: 5
Title: Raiders of the Lost Ark
Rating: PG
Genre: Action
Director: Steven Spielberg
Star: Harrison Ford
Award: Saturn Award for Best Actor, 1982
Inquire about another movie (Y/N)? y
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please enter the number of the movie you would like to know moreabout: 11
You must enter a number from 1 through 10!
Please enter the number of the movie you would like to know moreabout: 10
5
Title: X-Men
Rating: PG-13
Genre: Action
Director: Bryan Singer
Star: Hugh Jackman
Award: Saturn Award for Best Actor, 2001
Inquire about another movie (Y/N)? N
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks for using our experimental database!
BUILD SUCCESSFUL (total time: 2 minutes 21 seconds)
Sample run #2:
run:
EXPERIMENTAL AWARD-WINNING MOVIE DATABASE*
—————————————–
(*Funded in part by IMDb.com)
Movie titles are displayed alphabetically by default.
To display them alphabetically by genre, type G at theprompt.
Otherwise, simply press <Enter>.
Your preference? G
Selected award-winning movies by genre:
Action:
5) Raiders of the Lost Ark
10) X-Men
Biography:
8) The Queen
Comedy:
4) La La Land
Drama:
1) Contact
2) Driving Miss Daisy
3) Forrest Gump
6) Sophie’s Choice
9) Titanic
Sci-Fi:
7) Star Trek Into Darkness
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please enter the number of the movie you would like to know moreabout: 2
Title: Driving Miss Daisy
Rating: PG
Genre: Drama
Director: Bruce Beresford
Star: Morgan Freeman
Award: Golden Globe for Best Performance by an Actor in a MotionPicture – Comedy or Musical,
1990
Inquire about another movie (Y/N)? y
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please enter the number of the movie you would like to know moreabout: 12
You must enter a number from 1 through 10!
6
Please enter the number of the movie you would like to know moreabout: 7
Title: Star Trek Into Darkness
Rating: PG-13
Genre: Sci-Fi
Director: J.J. Abrams
Star: Chris Pine
Award: ASCAP Award for Top Box Office Films, 2014
Inquire about another movie (Y/N)? n
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks for using our experimental database!
BUILD SUCCESSFUL (total time: 2 minutes 11 seconds)
Expert Answer
Answer to 1 Create Interactive Java Application Implements Class Called Movie Class Derived Movie Ca Q27078492 . . .
OR