Answered You can hire a professional tutor to get the answer.

QUESTION

Amusement Park Programming Project Project Outcomes Use the Java selection constructs (if and if else). Use the Java iteration constructs (while, do,...

The class has three instance fields:

name, the name of the bookstore

tickets, an ArrayList<Ticket> storing Ticket objects

merchandise, an ArrayList<Merchandise> storing

Merchandise objects

getName() returns the name of the bookstore.

getTicketDates() returns an ArrayList<Date> of all the dates for which tickets are still available. If there are no tickets available, an empty list is returned.

getTickets (Date date) returns an integer indicating the number of tickets available for the specified date.

getTicket(long id) returns the Ticket that matches the specified id. If there is no Ticket matching the given id, null is returned.

getMerchandise()returns an ArrayList<Merchandise> of all the inventory (in-stock and ordered). This method must create a separate copy of the ArrayList before it returns the list. If there are no merchandise items in the AmusementPark, an empty list is returned.

getMerchandise(String category) returns a list of Merchandise objects whose category matches the specified category. For example, if called with "T-shirt" the method returns all Merchandise objects with the category "T-shirt" as a new list. This method must create a new copy of an ArrayList that stores all the matched Merchandise objects. If no items in the AmusementPark match the given name, an empty list is returned.

getMerchandise(long id) returns the merchandise item that matches the specified id. If there is no merchandise item matching the given id, null is returned.

addTicket(Ticket) adds a new Ticket to the inventory of the

AmusementPark.

addMerchandise(Merchandise) adds a new Merchandise to the inventory of the AmusementPark.

buyMerchandise(String id) removes a Merchandise object from the list of merchandise of the AmusementPark. If the id does not match any Merchandise object in the list, an exception is thrown.

buyTicket(String id) removes a Ticket object from the list of ticket items of the AmusementPark. If the id does not match any Ticket object in the list, an exception is thrown.

Design a tester class called AmusementParkTester. The tester class has a main() method and tests the functionality of the class AmusementPark as follows:

Create AmusementPark and name it "Walden Amusement Park".

Create a minimum of three Ticket objects and add them to the bookstore.

Createatleast of eachcategory,and themtothe

< > up a loop to:

Display ashort that ato differentactions thegift such aslooking oror Use allof accessor the access Usethe given to purchases.

< > the user for a specific action.

Depending the action the forinput such astheof aorcategory,etc. touse main() tohandleeach separately.

Performthe action and such asthelist of the has thetoString() to display on the

< > the user for continued access to the AmusementParkprogram should handle input errors gracefully. For example, if a particular ticket is searched and not found, the program should display a message such as "Selected ticket not found."

Implementation Notes:

All createa newtocopy newlist.This loopsto accessfromthe instance fieldsand addingthemto the new

< > error handling is essential for this project.

Javadoc be used to and

Merchandise.

Submission Requirements:

< > project submission should have four files for this assignment:< > - The Ticket class,< > - The Merchandise class,< > - The AmusementPark class,< > - A driver program for testing your AmusementPark class

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question