Design a tester class called amusementparktester

Assignment Help Programming Languages
Reference no: EM131476557

Question: 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.

Design a tester class called AmusementParkTester. The tester class has a main() method and tests the functionality of the class AmusementPark as follows:a. Create an AmusementPark b. create a minimum of three tickets objects and add them to the bookstore.c. create apparel objects at least two of each category and add them to the AmusementPark.d. set up a loop to I Display a short menu that allows a user to perform different actions in the gift shop such as looking up tickets or merchandise or purchasing items. Use all of the accessor methods in the AmusementPark to access specific items. Use the given methods to make purchasesii. Prompt the user for a specific action.iii. Depending on the specific action prompt the user for additional input such as the id of a ticker tor mechandise category, etc. You might want to use static methods in main() to handle ach menu item separately.iv. Perform the action and display results such as the list of merchandise that the user has requested. Use the toString() method to display AmusementPark items on the screen.v. Prompt the user for continued access to the AmusementPark or to end the program.

Reference no: EM131476557

Questions Cloud

Suggest the main tools that you would use : Suggest the main tools that you would use and the data that you would collect in order to analyze the business process and correct the problem.
What were the solutions used to address the problem : What were the solutions used to address the problem? Was the case you described a special-cause or common cause? Do you feel the solution or approach used?
How you integrate creativity into your own planning process : Identify the key steps that might require a contingency plan. Explain how you might integrate creativity into your own planning process.
How similar or different are your choices : You will be using a commonly used, lay friendly document on end of life planning called Five Wishes.
Design a tester class called amusementparktester : Develop class AmusementPark that keeps track of tickets and gift shop inventory. The AmusementPark uses two ArrayLists to store Ticket and Merchandise objects.
Is there a lead director who is not an officer of company : Is there a lead director who is not an officer of the company? What are the activities by activist shareholders regarding corporate governance issue of concern?
Standardized assessment scores : Is there a direct correlation between standardized assessment scores and the high school graduation rate in the state of Florida for the years 2010 through 2016
Prepare an annotated bibliography on one of the given factor : Prepare an annotated bibliography on one of the following factors that has had a significant impact on business and management communication in the past decade:
Doctor or dentist using the abdce structure : Write a very short story - not more than 200 words - about a trip to the doctor or dentist using the ABDCE structure.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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