Implement a simple amusement park information system

Assignment Help JAVA Programming
Reference no: EM131599431

Amusement Park Programming Project Project Outcomes

Use the Java selection constructs (if and if else).
Use the Java iteration constructs (while, do, for).
Use Boolean variables and expressions to control iterations.
Use arrays or ArrayList for storing objects.
Proper design techniques.
Project Requirements
Your job is to implement a simple amusement park information system that keeps track of admission tickets and merchandise in the gift shop. The information system consists of three classes including a class to model tickets, a class to model gift shop merchandise, the amusement park, and the amusement park tester. The gift shop supports access to specific merchandise in the park's gift shop and to purchase the merchandise or to order new merchandise for the gift shop. The UML diagram for each class (except the tester class) is given below.
Develop a simple class that models admission tickets. Each admission is described by several instance fields:
A ticket number as a long integer to identify the unique ticket,
A ticket category represented as a String to store the category of the ticket (i.e. adult, child, senior),
A ticket holder represented as a String to store the name of the person who purchased the ticket,
A date represented as a Date to store the admission date for the ticket,
A price represented as a double to store the price of the ticket,
A purchase status represented as a boolean to indicate if the ticket has been purchased (or is reserved).
In addition to these fields, the class has the following constructors and methods:
A parameterized constructor that initializes the attributes of a ticket.
setPrice(double price) to change the price of a textbook.
changePurchaseStatus(boolean newStatus) to change the purchase status of the ticket.
Accessor methods for all instance fields.
toString() to return a neatly formatted string that contains all the information stored in the instance fields.
Develop a simple class that models merchandise available in the gift shop such as t-shirts, sweatshirts, and stuffed animals. The class has several instance fields:
An ID as a long integer to identify the specific merchandise item,
A category as a String to store the specific type of merchandise,
A description as a String to store the description of the merchandise,
A price represented as a double to store the price of the merchandise,
An instock as a boolean to indicate if the merchandise is instock or on- order.
Valid values for category include "T-Shirt", "Sweatshirt", and "Stuffed Animal", as well as any additional category you choose to support. If invalid values are entered, an error message must be printed and the category instance field must be set to "UNKNOWN".
In addition to these attributes, the class has the following constructors and methods:
A parameterized constructor that initializes the attributes of a merchandise item.
setPrice(double price) to change the price of the merchandise.
setInstock(boolean newStatus) to change the status of the merchandise item.
Accessor methods for all instance fields.
toString() to return a neatly formatted string that contains all the information stored in the instance fields.
Merchandise
-id : long
-category : String
-description : String
-price : double
-inStock : boolean
+Merchandise(String, String, String, double, boolean)
+setPrice(double)
+setInstock(boolean)
+getId() : String
+getCategory() : String
+getDescription() : String
+getPrice() : double
+getInstock() : boolean
+toString() : String
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<Ticket>
-merchandise : ArrayList<Merchandise>
-name : String
+AmusementPark(String)
+getName() : String
+getTicketDates() : ArrayList<Date>
+getTickets(Date date) : int
+getTicket(long id) : Ticket
+getMerchandise() : ArrayList<Merchandise>
+getMerchandise(String category) : ArrayList<Merchandise>
+getMerchandise(long id) : Merchandise
+addTicket(Ticket)
+addMerchandise(Merchandise)
+buyMerchandise(String id)
+buyTicket(String id)
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

Reference no: EM131599431

Questions Cloud

What is the probability that this marble : A hat contains 40 marbles. Of them, 18 are red and 22 are green. If one marble is randomly selected out of this hat.
What media should advertisers use to reach you : Advertising receives substantial criticism, so accentuate the positive: what are the good things that advertising does for you and for society?
What did you find out about topic and about yourself : hat were your reasons for researching it? What did you find out about topic and about yourself? Did you find yourself seeking out primary or secondary sources?
Prepare the journal entry to recognize the income tax : Prepare the journal entry to recognize the income tax benefit of the net operating loss in 2016. Fores elects the carryback option
Implement a simple amusement park information system : Implement a simple amusement park information system that keeps track of admission tickets and merchandise in the gift shop.
Develop and communicate your ideas : Develop and communicate your ideas. Support your topic with evidence and details. Address the readers' concerns, opposing viewpoints, or counterarguments.
Proportion of females in the sample : On a specific day, a store in the mall took a random sample of 163 shoppers and recorded the proportion of females in the sample.
Hypothesis testing yields credible results : Question: Based on the above five steps, how would you ensure that your Hypothesis testing yields credible results?
Interpret anova results please : Sum of Squares between groups 559400 with df of 2 and mean square 279700. Sum of squares within groups 9483400 with df of 27 and mean square

Reviews

Write a Review

JAVA Programming Questions & Answers

  Method that reflects overloading

Example of a method that reflects overloading, and one that reflects polymorphism

  Determine the length of the string

You must give your user three opportunities for wrong input before you terminate the program.

  How css and javascript were actually used in your website

Write a 1-page document that details how HTML5, CSS, and JavaScript were actually used in your website. Justify your use of each.

  Using your musicalinstrument class

Finally, create a Java test class that simulates using your MusicalInstrument class.  In your test class you should at a minimum: a) Construct 4 instances of your instrument, b) tune your instruments, c) print the name of your instrument d) print ..

  Write a program to that finds lowest n closing dow jones

You are to write a program to that finds lowest N closing Dow Jones Industrial averages and their dates in order by closing average. The program should prompt for the number of lowest closing averages requested by the user to be output.

  Simulate the use and maintenance of a vending machine

ITP 120 Project - Write a set of classes that work together to simulate the use and maintenance of a vending machine. Your program should read in an input

  Design implement and test an object-oriented java program

Design, implement and test an object-oriented Java program for processing single-variable polynomials represented as lists.

  Get input for the grade letter in string format.

Use the grading criteria from this course for the numbers. (you must use charAt( ) so the string will work with your switch)

  Support for cloud-based strategies

In this course, you are introduced to general Windows Server concepts like active directory, group policy, security, networking and IIS, access control, and much more. Now that you understand the basic concepts, we will delve a little deeper and l..

  Program called power that displays the positive powers

Write a program called Power that displays the positive powers of 2. When the user enters the exponent at a prompt, the program displays 2 to that power. The program halts when the user enters -1

  Develop your programming and problem solving skills

The objective of this assignment is to develop your programming and problem solving skills in a step-by-step manner, assisted with visualization.

  Write a java program for the search the given position

Write a Java Program for the Generate 100000 positive numbers between (0,150), Search the position of the first "58" in the array and Count how many "58" in the array.

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