Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question: A set of classes is used to handle the different ticket types for a theater. All tickets have a unique serial number that is assigned when the ticket is constructed and a price. There are many types of tickets.

a. Design a class hierarchy that encompasses the above three classes.

b. Implement the Ticket abstract class. This class should store a serial number as its private data. Provide an appropriate abstract method to get the price of the ticket, provide a method that returns the serial number, and provide an implementation of toString that prints the serial number and price information. The Ticket class must provide a constructor to initialize the serial number. To do so, use the following strategy: maintain a static ArrayList representing previously assigned serial numbers. Repeatedly generate a new serial number using a random number generator until you obtain a serial number not already assigned.

2182_4.png

c. Implement the Fixed PriceTicket class. The constructor accepts a price. The class is abstract but you can and should implement the method that returns the price information.

d. Implement the WalkupTicket class and the ComplementaryTicket class.

e. Implement the AdvanceTicket class. Provide a constructor that takes a parameter indicating the number of days in advance that the ticket is being purchased. Recall that the number of days of advanced purchase affects the ticket price.

f. Implement the StudentAdvanceTicket class. Provide a constructor that takes a parameter indicating the number of days in advance that the ticket is being purchased. The toString method should include a notation that this is a student ticket. This ticket costs half of an Advanceticket. If the pricing scheme for AdvanceTicket changes, the StudentAdvanceTicket price should be computed correctly with no code modification to the StudentAdvanceTicket class.

g. Write a class TicketOrder that stores a collection of Tickets. TicketOrder should provide methods add, toString, and totalPrice. Provide a test program that creates a TicketOrder object and then calls add with all kinds of tickets. Print the order, including the total price.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92470663
  • Price:- $15

Priced at Now at $15, Verified Solution

Have any Question?


Related Questions in Computer Engineering

This is a software testing techniques class so i want to

This is a software testing techniques class so I want to write about test paths using node/edge or edge-pair coverage using a real or fictitous software project. Compose a short email to the decision-maker in your organi ...

A confidence interval for a population mean is to be

A confidence interval for a population mean is to be estimated. The population standard deviation is guessed to be anywhere from 14 to 24. The half-width B desired could be anywhere from 2 to 7. Tabulate the minimum samp ...

Truefalse questions no explanation is neededa on a

True/False Questions (NO explanation is needed): (a) On a Windows-based laptop computer the SECURITY registry file maintains a list of the host computer's wireless connections. (b) IEEE 802.11 Security Standard WEP (Wire ...

Question the three as of security are authentication

Question: The three A's of security are Authentication, Authorization, and Auditing. Write a 1-2 page paper in APA format describing these techniques and how they are used in your organization. What could be improved? Th ...

Define risk and explain why this concept is important to

Define risk and explain why this concept is important to small business managers.

With respect to bus request interruptswhat must be allowed

With respect to bus request interrupts: What must be allowed to complete before the interrupts is serviced? What resources (CPU, buses, memory, etc..) is the ISR expected to use? What is the ISR typically expected to do? ...

Question recall the on the spot courier service introduced

Question : Recall the On the Spot courier service introduced in Unit 1. The details of the package pickup and delivery process are described here. When Bill got an order, at first, only on his phone, he recorded when he ...

Question when setting quotas for disk space what are the

Question : When setting quotas for disk space, what are the two tools for enabling and configuring quotas? And which of the two are the more flexible? When creating a new share, what is the configuration option that enab ...

Be sure to answer all partsphosgenenbspcocl2nbspis a toxic

Be sure to answer all parts. Phosgene (COCl 2 ) is a toxic substance that forms readily from carbon monoxide and chlorine at elevated temperatures: CO( g ) + Cl 2 ( g ) ? COCl 2 ( g ) If 0.490 mol of each reactant is pla ...

1 explain how the following industries should adapt

1. Explain how the following industries should adapt their businesses to the ever expanding use of social networks and mobile computing (smart phones, tablet computers, etc.): 1) Media and Entertainment, 2) Department st ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As