Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following abstract Ticket class public abstract class Ticket private Date eventDate; II date of the show pblic Ticketate date)( eventDate- date public abstract
Consider the following abstract Ticket class public abstract class Ticket private Date eventDate; II date of the show pblic Ticketate date)( eventDate- date public abstract double getPrice/ returns the price of this ticket public String toStringo return "Date:" + eventDate.toString)+"nPrice:" +getPrice), This class was designed for the sale of theater tickets. As you probably know, there are different ticket categories at the theaters. For each question below , design and implement a concrete sub- class, and provide a separate Java source file as your solution. In addition to correctness and quality of design, in this homework, you will also be graded based on proper use of inheritance. That is, all relevant methods/properties of a subclass should be moved to the superclass as necessary. Q1. (20 pts.) RegularTicket class A regular ticket costs 10 TLs. * Include a constructor that takes the event date. Q2. (30 pts.) ReservedSeat class This is a ticket category that has a row number and a seat number. Rows 1 to 15 costs 30 TLs. Other reserved seat tickets cost 20 TLs. * Be careful with the String conversion method toString). This method should display (in addition to date and price) row number and seat number fields. *Include a constructor that takes the event date, row number and seat number
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