Part of your first project

Assignment Help Basic Computer Science
Reference no: EM13165691

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

Reference no: EM13165691

Questions Cloud

State a cylindrical bar of metal having a diameter : A cylindrical bar of metal having a diameter of (4.740x10^0) mm and a length of (9.9406x10^2) mm is deformed elastically in tension with a force of (1.281x10^4) N.
Matrix chain multiplication problem : Give an example which shows that in the matrix chain multiplication problem, adding a matrix on the right can force the breakpoint to the left. You can find an example using just 4 matrices
Interactive java program that asks a user for some interest : Create an interactive Java program that asks a user for some text of interest and then displays the first email address found in that text. (This is the basis for one of the programs that spammers use to mine text, such as email messages, Web pages, ..
Write a method called median : Write a method called median that accepts an array of integers as its argument and returns the median of the numbers in the array. The median is the number that will appear in the middle if you arrange the elements in order
Part of your first project : 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
Write a program to analyze students course marks : Write a program to analyze students course marks. The program should read in students course marks from "m2-grading.txt". The data file has a headline including students ID#, course-1marks, course-2 marks and course-3 markes.
Describe heat transfer between the gas and the tank : A tank containing carbon dioxide at 400K and 50 bar is vented until the temperature in the tank falls to 300K. Assuming there is no heat transfer between the gas and the tank
Compute the theoretical moles of naoh : calculate the theoretical moles of NaOH that should be necessary to reach the equivalence point
Decimal floating point number : What decimal floating point number does this IEEE 754 single precision number represent: 0x47C0_E6B7?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Degree of security in time-shared machine dedicated machine

Write down two such problems? Can we make sure same degree of security in time-shared machine as in dedicated machine?

  Creating a hashing function

Suppose you are creating a hashing function to use for storing string data in hashtable. One Candidate hasing function would be to sum the ASCII or Unicode values for each character, and that result as the hashcode.

  Based on the severity of a patient''s illness or injuries.

A triage software system that allows doctors to designate the order in which patients should be treated, based on the severity of a patient's illness or injuries.

  Determining z-transform and fourier transform

Consider the finite length sequencx(n)=D(n) + 0.5D (n-5). Determine z-transform and fourier transform of x(n). Determine N-point DFT of x(n) for N=50,10 and 5.

  What is the global cpi for each implementation?

Given a program with a dynamic instruction count of 1.0E6 instructions divided into classes as follows: 10% class A, 20% class B, 50% class C, and 20% class D, which implementation is faster?"

  Business reprocess engineering-strategic information system

Some people may say that Business Reprocess Engineering (BPR) is special case of strategic information system, whereas, others may say opposite is true. Describe this statement in scholarly detail.

  Convert decimal mumbers into bit binary number

Convert the following decimal mumbers into 8-bit binary numbers a required for 2's complement math, and perform the indicated operations.

  User enters a negative number or a nondigit number

If the user enters a negative number or a nondigit number, throw and handle an appropriate exception and prompt the user to enter another nonnegative number.

  Program that reads a series of whitespace

Write a program that reads a series of whitespace delimited strings from stdin and prints them back out, separated by spaces, in lexicographic order. You may assume that all strings are lower case and that no string has more than 20 characters.

  Create application to declares array of ten houseplant

Design an application that declares an array of 10 HousePlants. Prompt the user for data for each of the HousePlants, then display all values.

  Explaining communication methods which are beneficial

What additional communication methods not discussed in the reading do you believe are also beneficial? Explain what they are and how you know about them.

  Explaining why facebook-s design is different

Why is Facebook's design different? Or has Google merely perfected something that most organizations have just now started to "tackle"?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd