Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Need help on this. Must be in java. Make the code uniqie and no plagerism

for the following four problems, consider the task of representing ticket types for campus events. Each ticket has a unique number and price. There are three types of tickets: walk-in tickets, advance tickets, and student advance tickets. Figure 9.10 illustrates the types: • Walk-in tickets are purchased on the day of the event and cost $ 50. • Advance tickets purchased 10 or more days prior to the event cost $ 30 and advance tickets purchased less than 10 days prior to the event. event cost $ 40. Student Advance Tickets are sold at half the price of regular Advance Tickets - when purchased 10 or more days in advance, they cost $ 15, and when purchased less than 10 days in advance, they cost $ 20. Implement a class called Ticket that will serve as the superclass for all three types of tickets. Define all the common operations in this class and specify all the different operations in such a way that each subclass must implement them. No real objects of type Ticket will be created: Each real ticket will be an object of a subclass type. Define the following operations: • The ability to build a ticket by number. • The possibility of requesting the price of a ticket. • The ability to print a ticket object as a string. An example of a string would be "Number: 17, Price: 50.0". Ticket number Ticket (number) getPrice) toString Walkup Ticket Advance Ticket Advance Ticket for Students Figure 9.10 Ticket classes that are available for campus events 644 Chapter 9 Heritage and interfaces 6. Implement a class called WalkupTicket to represent an event ticket without appointment. Walk-in tickets are also built by number and are priced at $ 50. 7. Implement a class called AdvanceTicket to represent tickets purchased in advance. An advance ticket is built with a ticket number and the number of days in advance the ticket was purchased. Advance tickets purchased 10 or more days prior to the event are $ 30 and advance tickets purchased less than 10 days prior to the event are $ 40. 8. Implement a class called StudentAdvanceTicket to represent tickets purchased in advance by students. A student advance ticket is built with a ticket number and the number of days in advance the ticket was purchased. Advance student tickets purchased 10 or more days before the event cost $ 15, and advance student tickets purchased less than 10 days before the event cost $ 20 (half of a normal advance ticket). When a student advance ticket is printed, the chain must mention that the student must show their student ID (for example, "Number: 17, Price: 15.0 (ID required)").

Ticket
number
Ticket(number)
getPrice()
toString()
Walkup Ticket
Advance Ticket
Student Advance Ticket
expand button
Transcribed Image Text:Ticket number Ticket(number) getPrice() toString() Walkup Ticket Advance Ticket Student Advance Ticket
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education