Question
I would like to help (java): -------------------------------------------------------------- Consider the task of representing types of tickets to campus events. Each ticket has unique number and a
I would like to help (java):
--------------------------------------------------------------
Consider the task of representing types of tickets to campus events. Each ticket has unique number and a price. There are three types of tickets: walk-up tickets, advance tickets and student advance tickets. Walk-up tickets are purchased that day of the event and cost $50. Advance tickets purchased 10 or more days before the event cost $30, and advance tickets purchased fewer than 10 days before the event cost $40. Student advance tickets are sold at half the price of normal advance tickets. When they are purchased 10 or more days early, they cost $15, and when they are purchased fewer than 10 days early they cost $20. Implement a class called Ticket that will serve as the superclass for all three types of tickets. Define all common operations in this class, and specify all differing operations in such a way that every subclass must implement them. No actual object of type Ticket will be created; each actual ticket will be an object of a subclass type. Define the following operations: The ability to construct a ticket by number. The ability to ask for a ticket's price. The ability to print a ticket object as a String. An example string would be "Number: 17, Price: 50.0". Implement the class WalkupTicket to represent a walk-up event ticket. Walk-up tickets are also constructed by number and they have a price of $50. Implement the class AdvanceTicket to represent tickets purchased in advance with the rules above. Implement the class StudentAdvanceTicket to represent tickets purchased in advance by students with the rules and prices above. When a student advance ticket is printed, the String should mention that the student must show his or her student ID, such as: "Number: 19, Price: 15.0 (ID required)".
Runner class - Your runner class should be user interactive. This means it allows the user to create tickets of ever type until done. After the user is done, all tickets should be printed out to the screen.
Rubric:
Superclass Tracks unique ticket numbers Contains an ArrayList of Tickets Constructor Appropriate accessor/mutator methods Appropriate Override methods Subclasses Extends superclasses Constructor Appropriate accessor/mutator methods Appropriate Override methods Uses "super" keyword correctly
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