Create an abstract class called Movie. The class should declare the following variables: an instance variable that describes the title - String an instance variable that describes the rating - double an instance variable that describes the director - String an instance variable that describes the genre - String an instance variable that describes the year – integer an instance variable that describes the language – String an instance variable that describes the ticket price - double   Create the getter and setter methods for each instance variable except setter for ticket price and getter for genre. Create the necessary constructors. Include an abstract method setTicketPrice(double ticketPrice) to determine the ticket price for a movie. Include an abstract method getGenre() to return the genre of the movie. Provide a toString() method that returns the information stored in the above variables.   Create three subclasses called ThrillerMovie, ComedyMovie, and ChildrenMovie. These subclasses should override the abstract methods setTicketPrice and getGenre of class Movie.   Use the following rule for setting the ticket price for a movie:   Children movies will have a 10% discount Thriller movies will have a fixed price (specified by user) Comedy movies will have a 5% discount   Write a driver program (another class with main method) that uses the above hierarchy. In your driver program you must implement an interaction with the user. Use showInputDialog method to let the user input movie information. Use showMessageDialog method to display movie information including price and type for movies.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Create an abstract class called Movie. The class should declare the following variables:

  • an instance variable that describes the title - String
  • an instance variable that describes the rating - double
  • an instance variable that describes the director - String
  • an instance variable that describes the genre - String
  • an instance variable that describes the year – integer
  • an instance variable that describes the language – String
  • an instance variable that describes the ticket price - double

 

Create the getter and setter methods for each instance variable except setter for ticket price and getter for genre. Create the necessary constructors. Include an abstract method setTicketPrice(double ticketPrice) to determine the ticket price for a movie. Include an abstract method getGenre() to return the genre of the movie. Provide a toString() method that returns the information stored in the above variables.

 

Create three subclasses called ThrillerMovieComedyMovie, and ChildrenMovie.

These subclasses should override the abstract methods setTicketPrice and getGenre of class Movie.

 

Use the following rule for setting the ticket price for a movie:

 

  • Children movies will have a 10% discount
  • Thriller movies will have a fixed price (specified by user)
  • Comedy movies will have a 5% discount

 

Write a driver program (another class with main method) that uses the above hierarchy. In your driver program you must implement an interaction with the user.

  • Use showInputDialog method to let the user input movie information.
  • Use showMessageDialog method to display movie information including price and type for movies.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY