Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

On completion of this course you are hired by the company Tickets R Us. Part of your first project is to develop an application to assist with the selling of tickets. After discussing with your client, you identify that each ticket requires two attributes: a serial number and a price. You also identify that three types of tickets are sold: counter tickets, Web tickets, and discount tickets. Following are the specifications: 1. Counter tickets are sold on the day of the event at a ticket counter. They cost £50. 2. Web tickets are purchased on the internet. Web tickets purchased a week in advance of the event are £30 and those purchased less than a week in advance are £40. 3. Discount tickets are a type of Web tickets. They are available for students and senior citizens. They are 50 percent off normal Web ticket prices, i.e. if purchased a week or more in advance they are £15 and if purchased less than a week in advance they are £20. To purchase a discount ticket you either need to be a student or a senior citizen. Proper identification will be needed at the time the ticket is collected. The reason for the discount (student or senior) will be printed on the ticket. For this assignment implement the following: a. A class called Ticket which will be the superclass of both types of tickets (CounterTicket and WebTicket). All common fields and operations (methods) need to be implemented for this class. Following are additional specifications for this class 1. each time a ticket is made, a serial number is incremented. 2. A constructor Ticket() 3. a method public int getPrice() to return the ticket's price 4. a method public String toString() returns a String. This return value can be used to print a ticket b. The class WebTicket inherits from Ticket. o A constructor WebTicket(int days) c. The class DiscountTicket inherits from WebTicket. o A constructor DiscountTicket(int days, String type) o Since discount tickets indicate the type of discount (i.e. 'student' or 'senior''), you will need to override the toString() method. d. Pricing information about the various tickets need to be given in the form of static variables as shown below: public static int COUNTER_TICKET_PRICE = 50; public static int WEB_TICKET_PRICE = 30; public static int WEB_TICKET_LT_WEEK_PRICE = 40; public static double DISCOUNT = 0.5; Please note that you have to place the static variables mentioned above in the appropriate classes (for example, Web ticket pricing information would be in WebTicket). To guide your development efforts as part of this assignment description you are provided a TicketsTst class and a test method. Include this class in your BlueJ project (easiest way would be to create a new TicketsTst class within BlueJ and then cut and paste the code you have been provided). For convenience, the test method is static. Hence, you do not need to create an instance of TicketsTst. Just right click on Ticketstst and run the test method. On running the test method your output should look like the following: Ticket: [ serial#: 0 Price: 30] Ticket: [ serial#: 1 Price: 40] Ticket: [ serial#: 2 Price: 50] Ticket: [ serial#: 3 Price: 20 Type: Student] Ticket: [ serial#: 4 Price: 15 Type: Senior] Total sales: 155

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9455809

Have any Question?


Related Questions in Computer Engineering

Question suppose that you are searching an unsorted array

Question : Suppose that you are searching an unsorted array of objects that might contain duplicates. Devise an algorithm that returns a list of the indices of all objects in the array that match a given object. If the d ...

Smartphones have become an important part daily life

Smartphones have become an important part daily life, including how we communicate in business. Mobile device security is emerging as one of top targets for cybercriminals. Using Microsoft Word, write a 400 word paper us ...

Suppose you want to back up a huge file to a cd-r you can

Suppose you want to back up a huge file to a CD-R. You can do this by splitting the file into smaller pieces and backup up those pieces separately. Write a utility program named FileSplitter that splits a large file into ...

Represent the number obtained by the last you have digits

Represent the number obtained by the last you have digits of your student number in binary, e.g., if your student number is XXX8372 then the question is to represent "8372" in binary. Also, represent the first three digi ...

Systems analysis chapter 6 please answer the four questions

Systems analysis chapter 6: Please answer the four questions at the tasks section Campus Bikes is a popular bicycle shop located near a major university. The business has grown and the owner, Mark Turner, wants to instal ...

Question summarize the human-computer interface hci of

Question : Summarize the human-computer interface (HCI) of Microsft Word 2013 and Microsoft Visio 2013. Explain the importance of HCI and usability of the software. Be sure to note any commonalities between the applicati ...

Taskstudents are required to do the following tasks for

Task Students are required to do the following tasks for write report by answering all the questions at the end of case study: Task a: Answering all the questions at the end of case study. Task b: Student is required to ...

Question a simm has a capacity of 32mx64how many 32mx8

Question : A SIMM has a capacity of 32Mx64. How many 32Mx8 DRAMa are reqquired to make this SIMM? How many address lines does the SIMM require? How should the DRAMs Be connected ?

I suppose alice wants to send a long message m to bob if

(i) Suppose Alice wants to send a long message m to Bob. If Alice and Bob already share a secret key k, and they use HMAC to protect the integrity of the message m, what should the message format be (or what components s ...

Question what are the advantages and disadvantages of using

Question: What are the advantages and disadvantages of using the same system-call interface for manipulating both files and devices? It is sometimes difficult to achieve a layered approach if two components of the operat ...

  • 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