subject
Computers and Technology, 08.03.2021 19:20 kdd46

Consider the scenario at a high school football ticket stand. Tickets for the games are sold at various times and have different prices depending on how early the ticket is purchased. In this programming assignment you will need to create four classes and a driver program. The parent class called Ticket should be an abstract class. Three classes, should extend the Ticket class and be called AdvanceBooking, CurrentBooking and DiscountBooking. Finally, create a test class called Driver. The rules for purchasing tickets are:
• CurrentBookings are for tickets purchased for games happening today. They cost $75 each
• AdvancedBookings are for tickets purchased for games happening in the future. If the game is less than 15 days in the future, tickets cost $50 each, if they are 15 or more days in the future, they cost $25 each. (Note – if the NoOfDays =0 the program transfers control to the CurrentBookings class.
• Finally, students can purchase discount tickets for $10, as long as they are for games at least 1 day in the future otherwise they are $75.
4 Classes and a driver program UML diagram - PDF format.
Assignment Requirements:
The ticket. java / ticket. cs abstract class is the parent class that all other classes will extend. This class holds all common operations such that the subclasses can implement the methods specified here. This class should have the following operations:
• A constructor which generates a ticket with a ticketNumber (Integer) o The class should have a variable called NextTicketNumber which should be initialized to 1. When each ticket is created, they should be assigned the next integer regardless of the type of ticket.
• A getPrice ( ) method which returns the ticket price (In ticket it is an abstract method)
An override of the toString / toString method that prints the type of ticket, ticket number, and price of ticket.
currentbooking class is a subclass that allows for tickets to be purchased on the day of the game. When created, each ticket should be assigned the next ticket number, and have their price set to $75.
advancebooking class is a subclass that represents tickets purchased in advance. In order to create an AdvancedBooking, the number of days till the game (numDaysUntilGame – an integer variable) must be passed in at the time the ticket is created. Like CurrentBookings, AdvancedBookings will be assigned the next ticket number. If the game is 15 days or more in the future, the ticket will cost $25. If the game is in less than 15 days, the ticket will cost $50.
discountBooking class is a subclass that allows for students to purchase tickets in advance. In order to create a DiscountBooking object, the number of days until the game (numDaysUntilGame – an integer variable) must be passed in at the time the ticket is created. Like all other ticket types, the next ticket number will be assigned. If the game is today, the ticket price is the normal $75, however, if the game is any other day, it will cost $10.
PurchaseTicket Program
The purchaseTicket (driver) program should have a menu of options for a person to purchase and see tickets. The program should keep going until the user selects exit. The menu has the following options: 1. Sell a Ticket for a future gam 2. Sell a Ticket for today’s game 3. Sell a Discount Ticket 4. Print All Tickets 5. Exit
All input/output statements should be in the driver program only.
All tickets should have a unique ticket number.
As tickets are created, regardless of which type of ticket they are, they should be stored in an arraylist. If option 2 or 3 are selected, you’ll need to ask the user how many days in the future the game is.
If option 4 is selected, it should print out all tickets which have been sold by simply calling print on the object name. As long as you successfully overrode toString/ToString it should print out a message including the ticket type, ticket number and price.
Demonstrate polymorphism when creating the tickets and storing them in the ArrayList.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
To hide gridline when you display or print a worksheet
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Write a function called checkfactor that takes two arrays of positive numbers, firstnumberrow and secondnumberrow. checkfactor checks if the first entry in firstnumberrow is divisible by the first entry in secondnumberrow, and performs the same operation on the next array elements until all entries have been checked. all the numbers are positive and the number of entries in the arrays are the same. the function should return the identified divisible numbers in two row arrays named firstdivisible and seconddivisible.restrictions: branches or loops should not be used. the code must use the internal mod and logical functions.hint: the mod function should be used to determine if two numbers are divisible. ex: for num1 and num2 if mod(num1,num2) is 0, then the two numbers are divisible.this is matlab
Answers: 2
question
Computers and Technology, 23.06.2019 10:00
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
You know the right answer?
Consider the scenario at a high school football ticket stand. Tickets for the games are sold at vari...
Questions
question
Mathematics, 02.02.2020 21:45
question
Physics, 02.02.2020 21:45
question
Mathematics, 02.02.2020 21:45
question
History, 02.02.2020 21:46