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)")
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)").
Trending now
This is a popular solution!
Step by step
Solved in 8 steps