Amusement park programming project

Assignment Help Basic Computer Science
Reference no: EM13822281

Amusement Park Programming Project 

Project Outcomes

1. Use the Java selection constructs (if and if else). 2. Use the Java iteration constructs (while, do, for). 3. Use Boolean variables and expressions to control iterations. 4. Use arrays or ArrayList for storing objects. 5. 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. 

1) Develop a simple class that models admission tickets. Each admission is described by several instance fields: a. A ticket number as a long integer to identify the unique ticket, b. A ticket category represented as a String to store the category of the ticket (i.e. adult, child, senior), c. A ticket holder represented as a String to store the name of the person who purchased the ticket, d. A date represented as a Date to store the admission date for the ticket, e. A price represented as a double to store the price of the ticket, f. A purchase status represented as a boolean to indicate if the ticket has been purchased (or is reserved).

Ticket

-number : long -category : String -holder : String -date : Date  -price : double 

In addition to these fields, the class has the following constructors and methods: a. A parameterized constructor that initializes the attributes of a ticket. b. setPrice(double price) to change the price of a textbook. c. changePurchaseStatus(boolean newStatus) to change the purchase status of the ticket. d. Accessor methods for all instance fields. e. toString() to return a neatly formatted string that contains all the information stored in the instance fields. 

2) 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: a. An ID as a long integer to identify the specific merchandise item, b. A category as a String to store the specific type of merchandise, c. A description as a String to store the description of the merchandise, d. A price represented as a double to store the price of the merchandise, e. An instock as a boolean to indicate if the merchandise is instock or onorder. 

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: f. A parameterized constructor that initializes the attributes of a merchandise item. g. setPrice(double price) to change the price of the merchandise. h. setInstock(boolean newStatus) to change the status of the merchandise item. i. Accessor methods for all instance fields. j. toString() to return a neatly formatted string that contains all the information stored in the instance fields. 

+Ticket (String, String, Date, double, boolean)  +setPrice(double) +changePurchaseStatus(boolean) +getNumber() : long +getCategory() : String +getHolder() : String +getDate() : String +getPrice() : double +toString() : String 

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  

3) 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) 

a. The class has three instance fields: a. name, the name of the bookstore b. tickets, an ArrayList<Ticket> storing Ticket objects

c. merchandise, an ArrayList<Merchandise> storing Merchandise objects b. getName() returns the name of the bookstore. c. 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. 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<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. 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. 

4) 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 AmusementPark and name it "Walden Amusement Park". b. Create a minimum of three Ticket 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 purchases. ii. 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 ticket or merchandise category, etc. You might want to use static methods in main() to handle each 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. 

Your program 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." Feel free to experiment with the tester program in order to develop a more useful program.  

Implementation Notes: 1) All accessor methods in AmusementPark must create a new ArrayList to copy objects into the new list. This requires loops to access objects from the corresponding instance fields and adding them to the new ArrayList. 2)  Proper error handling is essential for this project.  3) Javadoc must be used to document AmusementPark, Ticket, and Merchandise.   Submission Requirements: 1. Your project submission should have four files for this assignment:  a. Ticket.java - The Ticket class, b. Merchandise.java - The Merchandise class, c. AmusementPark.java - The AmusementPark class, d. AmusementParkTester.java - A driver program for testing your AmusementPark class.  2. Remember to compile and run your program one last time before you submit it 

Reference no: EM13822281

Questions Cloud

Organizations can develop their own corporate culture : Some people argue that organizations can develop their own corporate culture, and that doing so will make differences in country cultures irrelevant to effectively managing human resources. Do you agree?  Explain your opinion.
Organizations can develop their own corporate culture : Some people argue that organizations can develop their own corporate culture, and that doing so will make differences in country cultures irrelevant to effectively managing human resources. Do you agree?  Explain your opinion.
Runtime is an important concept in matrix operations : Runtime is an important concept in matrix operations in computer applications, particularly when massive calculations are involved in programming. In this week's discussion, you will explore these applications. Step I:Define the termruntime,and list..
Affect the purchasing power of potential customers : What kind of economic factors affect the purchasing power of potential customers and the firm's cost of capital such as economic growth, interest rates, exchange rates, etc.
Amusement park programming project : 1. Use the Java selection constructs (if and if else). 2. Use the Java iteration constructs (while, do, for). 3. Use Boolean variables and expressions to control iterations. 4. Use arrays or ArrayList for storing objects. 5. Proper design techniques.
Examples of differentiation within some organization : What are some examples of differentiation within some organization? In other words, what specialized tasks have to be performed, and how is labor typically divided? Also, an example of how a company in the service industry may integrate different uni..
What does the sql query : What does the following SQL query do? sqlStr = "SELECT* FROM computers WHERE Speed >2 AND Memory > 4 ORDER BY OS-Type"
High-level strategic human resource management plan : Write a high-level strategic human resource management plan. The purpose of this assignment is to simulate the thought process managers use to connect unit goals with organizational strategy. The students are not expected to produce a detailed strate..
Draw a constellation pattern for a modem : Draw a constellation pattern for a modem that uses eight equally spaced phase angles and four equally spaced amplitude levels. If the modem operates at 4800 baud, what is the bit rate?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Example of weighted directed grap with weight function

Provide an example of weighted directed graph G = (V, E) with weight function ω:E→R and source vertex s such that G satisfies following property.

  Google maps or similar available web services

Using Yahoo! Maps, Google Maps or similar available Web services, create an rssGEO2.0.xml document that will group and display at least five different geographical locations. The theme of the locations is up to you, but include your favorite vacation..

  The impact of social networks on big box retailers

On a recent flight, you sat next to Mr. Mike Duke, the former CEO of Walmart, who is a Georgia Tech alumnus. Your conversation dealt with the impact of social networks on big box retailers.

  Fluid mechanics

Consider a two-dimensional velocity ?eld V~ = aˆi + by2ˆj, where a = 1 m/s and b = 2 m?1s-1

  Find statistics of the given list of integers

You will be writing a homework using functions to get a list of integers from a user and then find statistics of the given list of integers. You are not allowed to use any built in functions for finding the calculations in this assignment.

  Submit a java program comprising two source files

Submit a Java program comprising two source files: MyArrayList.java, defining a generic MyArrayList class representing "stretchy" arrays. This class is to mimic some features of the built-in ArrayList generic collection class .

  Draw a level 0 data flow diagram

Once the glasses have been made, you return to the store for a fitting and pay for glasses. The payment information is recorder in the order. You can use any tool to draw the diagram.

  Web page makes effective and consistent use of headings

Use search engine to determine the example of Web page which makes effective and consistent use of headings to organize Web page content.

  Write a program to manage a dictionary

Then ask whether the user wants to add this new word to the dictionary. If the answer is yes, do so and go back to request the next word.

  How it would be used as part of a problem solution

How it would be used as part of a problem solution.

  Develop a framework for the it steering committee

Develop a framework for the IT steering committee, explaining the roles and responsibilities of the members.

  Incorporate this method into an application

Incorporate this method into an application that inputs a series of pairs of integers (one pair at a time) and determines whether the second value in each pair is a multiple of the first

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