Question: In your text, Building Java Programs, 5th Edition, in Chapter 9, starting on page 662 (eBook; printed text is the same), please work exercises 5,

In your text, Building Java Programs, 5th Edition, in Chapter 9, starting on page 662 (eBook; printed text is the same), please work exercises 5, 6, 7, and 8. What you must submit for this assignment are the Java source file definitions of the classes, Ticket, WalkupTicket, AdvanceTicket, and StudentAdvanceTicket, each including the methods specified in the exercise. All these must be submitted along with a client that demonstrates the operation of all the functions in the class hierarchy, i.e., a simulated purchase of each possible kind of ticket to this event. Can someon help Please ?
In your text, Building Java Programs, 5th Edition, in Chapter 9, starting
on page 662 (eBook; printed text is the same), please work exercises
5, 6, 7, and 8. What you must submit for this assignment

5. For the next four problems, consider the task of representing types of tickets to campus events. Each ticket has a unique number and a price. There are three types of tickets: walk-up tickets, advance tickets, and student advance tickets. Figure 9.10 illustrates the types: Figure 9.10 Classes of tickets that are available to campus events Ticket number Ticket(number) getPrice toStringo Walkup Ticket Advance Ticket Student Advance Ticket Walk-up tickets are purchased the day of the event and cost $50. Advance tickets purchased 10 or more days before the event cost $30, and ad- vance 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 pur- chased fewer than 10 days early they cost 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 imple- ment them. No actual objects of type Tick- et will be created: Each actual ticket will be an object of a subclass type. Define the fol- lowing operations: The ability to construct a ticket by number. The ability to ask for a ticket's price. The ability to println a ticket object as a String. An example String would be "Number: 17, Price: 50.0". 6. Implement a class called WalkupTicket to represent a walk-up event ticket. Walk-up tickets are also constructed by number, and they have a price of $50. 7. Implement a class called AdvanceTicket to represent tickets purchased in advance. An advance ticket is constructed with a ticket number and with the number of days in ad- vance that the ticket was purchased. Ad- vance tickets purchased 10 or more days be- fore the event cost $30, and advance tickets purchased fewer than 10 days before the event cost $40. 6. Implement a class called WalkupTicket to represent a walk-up event ticket. Walk-up tickets are also constructed by number, and they have a price of $50. 7. Implement a class called AdvanceTicket to represent tickets purchased in advance. An advance ticket is constructed with a ticket number and with the number of days in ad- vance that the ticket was purchased. Ad- vance tickets purchased 10 or more days be- fore the event cost $30, and advance tickets purchased fewer than 10 days before the event cost $40. 8. Implement a class called StudentAd- vanceTicket to represent tickets pur- chased in advance by students. A student advance ticket is constructed with a ticket number and with the number of days in ad- vance that the ticket was purchased. Student advance tickets purchased 10 or more days before the event cost $15, and student ad- vance tickets purchased fewer than 10 days before the event cost $20 (half of a normal advance ticket). When a student advance ticket is printed, the String should mention that the student must show his or her student ID (for example, "Number: 17, Price: 15.0 (ID required)")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!