Question
1. Create an interactive Java application that implements a class called Movie, a class derived from Movie called AwardWinningMovie, and a driver to demonstrate the
1. Create an interactive Java application that implements a class called Movie, a class derived from Movie called AwardWinningMovie, and a driver to demonstrate the functionality of the two classes. Implementation specifics are described below. As usual, your program 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 type Movie 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 class according to the following specification: Five private instance variables that represent title (type String), rating (type String), genre (type String), director (type String), and star (type String). A five-argument constructor that initializes the five instance variables. set and get methods for each of the five instance variables. An equals method that compares two Movie objects for equality and returns a boolean value. A toString method that generates nicely formatted output of the Movie attributes. (Note: Your toString method must override the toString method of class Object.)
Part 2. Create a subclass of Movie called AwardWinningMovie with two additional attributes, award title and award year. For example, Star Trek into Darkness won the ASCAP Award for Top Box Office Films (award title) in 2014 (award year).) Implement the AwardWinningMovie class according to the following specification: Private instance variables awardTitle (type String) and awardYear (type int). A seven-argument constructor that initializes the seven instance variables. (Hint: Start by using the superclass constructor to initialize the inherited instance variables.) set and get methods for each of the two additional instance variables. An equals method that compares two AwardWinningMovie objects for equality and returns a boolean value. A toString method that generates nicely formatted output of all of the AwardWinningMovie attributes.
Part 3. Create an interactive driver to test your program. The driver begins by creating a database of a minimum of 10 AwardWinningMovie objects. (Implement the database using an array or an ArrayList.) It then provides the user with two options: display the award-winning movies alphabetically by title, or display the award-winning movies alphabetically by genre. Next, it prompts the user to select a movie to obtain more information about. Please note that the driver must validate the users input. Specifically, it must use exception handling (try-catch block) in combination with one or more loops to deal with the possible entry of non-integer values as well as the entry of out-of-range values. Once the input has been validated, the driver displays the requested information about the movie. Finally, the driver asks the user if s/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 with the option to search the experimental database by one of the AwardWinningMovie attributes (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 the prompt. Otherwise, simply press
Step 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