Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 1 - Examine Provided Code First, read README.md. Then familiarize yourself with Ticket Interface.java and Basicticket. java. Note which methods are present, which are
Task 1 - Examine Provided Code First, read README.md. Then familiarize yourself with Ticket Interface.java and Basicticket. java. Note which methods are present, which are abstract, and the variables defined in each. Task 2 - Write FloorTicket Tests FloorTicket should extend BasicTicket. It should implement all abstract methods in Basicticket, include a constructor, override getCost and tostring, and add a new instance variable, int zone. The constructor should have the following signature: FloorTicket (String name, TicketInterface.Event event, String date, int seatNum) tostring should return a string in the format: For example: Bob Builder 12/15/2050: zone 4 Write tests to verify that all methods a FloorTicket object contains return correct values (even those implemented in BasicTicket). Task 3 - Write VIPTicket Tests VIPTicket should also extend BasicTicket. It should implement all abstract methods in Basicticket, include a constructor, override getCost and tostring, and add new instance variables, int box and double cost. The constructor should have the following signature: VIPTicket(String name, Ticketinterface.Event event, String date, int boxNum) tostring should return a string in the format: Box reserved on For example: Ada Lovelace Box 6 reserved on 12/15/2050 Write tests to verify that all methods a vIPTicket object contains return correct values (even those implemented in BasicTicket). Since the price of the ticket depends on the box number, make sure you have a test for each price. Task 4 - Implement Child Classes Implement FloorTicket and VIPTicket according to the specifications given above. public int getLocation () ; / Returns the price of the ticket / public double getcost () ; * Represents a ticket for a box seat * @author */ ublic class VIPTicket extends BasicTicket // TODO: VIPTicket needs a private double cost and private int box // TODO: Constructor // Don't forget to call super(...)toinitializeinstancevariables // stored in BasicTicket // TODO: Override getLocation // TODO: Override getcost // TODO: Override tostring
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