Ha – tickets | Computer Science homework help

HA – tickets

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:

Counter tickets are sold on the day of the event at a ticket counter. They cost £50.

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.

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 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

each time a ticket is made, a serial number is incremented.

A constructor Ticket()

a method public intgetPrice() to return the ticket’s price

a method public String toString() returns a String. This return value can be used to print a ticket

The class WebTicket inherits from Ticket.

A constructor WebTicket(int days)

The class DiscountTicket inherits from WebTicket.

A constructor DiscountTicket(int days, String type)

Since discount tickets indicate the type of discount (i.e. ‘student’ or ‘senior’), you will need to override the toString() method.

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

 

Create a new project in BlueJ by clicking on the menu option Project > New project. This will create a folder with the project name (see below). All BlueJ project related files for this project will be stored in this folder. Create new classes by clicking on the [New Class] button. All Java class files that you create (.java files) will be stored in the BlueJ project folder. The project folder will contain other files as well. After completing and testing your assignment, zip the entire BlueJ folder and submit it. Since your instructor will need all files in the project folder, make sure you zip the entire folder. For this assignment the names of the BlueJ project, Java class files, and the zip file you submit are given below:

 

BlueJ project: tickets

Java classes: Ticket.java, CounterTicket.java, WebTicket.java, DiscountTicket.java

Submit: tickets.zip

 

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more