Develop class AmusementPark that keeps track of tickets and gift shop inventory. The…

Develop class AmusementPark that keeps track of tickets and gift shop inventory. The…

Develop class AmusementPark that keeps track of tickets and gift shop
inventory. The AmusementPark uses two ArrayLists to store Ticket and
Merchandise objects. The AmusementPark provides several methods to
add merchandise to the gift shop and to access merchandise. The following
UML diagram describes the class, the constructor, and the methods:
AmusementPark
-tickets : ArrayList
-merchandise : ArrayList
-name : String
+AmusementPark(String)
+getName() : String
+getTicketDates() : ArrayList
+getTickets(Date date) : int
+getTicket(long id) : Ticket
+getMerchandise() : ArrayList
+getMerchandise(String category) : ArrayList
+getMerchandise(long id) : Merchandise
+addTicket(Ticket)
+addMerchandise(Merchandise)
+buyMerchandise(String id)
+buyTicket(String id)
a. The class has three instance fields:
a. name, the name of the bookstore
b. tickets, an ArrayList storing Ticket objects © 2014 Laureate Education, Inc. Page 4 of 5
c. merchandise, an ArrayList storing
Merchandise objects
b. getName() returns the name of the bookstore.
c. getTicketDates() returns an ArrayList of all the dates
for which tickets are still available. If there are no tickets available, an
empty list is returned.
d. getTickets (Date date) returns an integer indicating the number
of tickets available for the specified date.
e. getTicket(long id) returns the Ticket that matches the
specified id. If there is no Ticket matching the given id, null is
returned.
f. getMerchandise()returns an ArrayList 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.
g. 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.
h. 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.
i. addTicket(Ticket) adds a new Ticket to the inventory of the
AmusementPark.
j. addMerchandise(Merchandise) adds a new Merchandise to the
inventory of the AmusementPark.
k. 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.
l. 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.

Develop class AmusementPark that keeps track of tickets and gift shop inventory. The…

TALK TO SUPPORT VIA LIVE CHAT TO SEE THIS ANSWER AT $ 10 ONLY