Question

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

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

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Amusement Park Programming Project Project Outcomes Use the Java selection constructs (if and if else). Use...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Programming Project #5 Project Outcomes: Develop a Java program that Uses selection constructs (if, and if...

    Programming Project #5 Project Outcomes: Develop a Java program that Uses selection constructs (if, and if else). Uses the Java iteration constructs (while, do, for). Uses static variables. Ensure integer variables input are within a range that will not cause integer overflow. Uses proper design techniques including reading UML Class Diagrams Background Information: The Unified Modeling Language (UML) provides a useful notation for designing and developing object-oriented software systems. One of the basic components of the UML is a class...

  • This is a java file and I am very confused on how to do this project!...

    This is a java file and I am very confused on how to do this project! please help!! Specifications Overview: You will write a program this week that is composed of three classes: the first class defines Ellipsoid objects, the second class defines EllipsoidList objects, and the third, Ellipsoid ListApp, reads in a file name entered by the user then reads the list name and Ellipsoid data from the file, creates Ellipsoid objects and stores them in an ArrayList of...

  • The following is for java programming. the classes money date and array list are so I are are pre...

    The following is for java programming. the classes money date and array list are so I are are pre made to help with the coding so you can resuse them where applicable Question 3. (10 marks) Here are three incomplete Java classes that model students, staff, and faculty members at a university class Student [ private String lastName; private String firstName; private Address address; private String degreeProgram; private IDNumber studentNumber; // Constructors and methods omitted. class Staff private String lastName;...

  • IN JAVA PLEASE Lab 28.1 Add a class named Purchase with: an instance (String) variable for...

    IN JAVA PLEASE Lab 28.1 Add a class named Purchase with: an instance (String) variable for the customer's name an instance (double) variable for the customer's balance a member method public String toString() that returns the object's instance variable data as a single String; e.g., Cathy has a balance of $100.00 Lab 28.2 Add a main class named Store; . Then, add code that: declares and creates an ArrayList of Purchase objects named purchases (make sure to add import java.util.ArrayList...

  • Write a Java program which will store, manipulate, and print student registration information. As part of...

    Write a Java program which will store, manipulate, and print student registration information. As part of the solution, identify the following classes: Student Admissions. The class Student must have the following fields – Name, Address, Id number, Courses, and Date, where: Name is a user defined class comprising of at minimum first name and last name. Address is a user defined class comprising of fields - street, city, state, and zip code. Date is a predefined class in the java.util...

  • This project will use The Vigenere Cipher to encrypt passwords. Simple letter substitution ciphers are ones...

    This project will use The Vigenere Cipher to encrypt passwords. Simple letter substitution ciphers are ones in which one letter is substituted for another. Although their output looks impossible to read, they are easy to break because the relative frequencies of English letters are known. The Vigenere cipher improves upon this. They require a key word and the plain text to be encrypted. Create a Java application that uses: decision constructs looping constructs basic operations on an ArrayList of objects...

  • Java Project In Brief... For this Java project, you will create a Java program for a...

    Java Project In Brief... For this Java project, you will create a Java program for a school. The purpose is to create a report containing one or more classrooms. For each classroom, the report will contain: I need a code that works, runs and the packages are working as well The room number of the classroom. The teacher and the subject assigned to the classroom. A list of students assigned to the classroom including their student id and final grade....

  • CMSC 256 – Project 5 Programming Assignment 5 Note: When you turn in an assignment to...

    CMSC 256 – Project 5 Programming Assignment 5 Note: When you turn in an assignment to be graded in this class, you are making the claim that you neither gave nor received assistance on the work you turned in (except, of course, assistance from the instructor or teaching assistants). Program: Ticketing System Points: 100 A set of classes is used to handle the different ticket types for a theater event. All tickets have a unique serial number that is assigned...

  • *** FOR A BEGINNER LEVEL JAVA CLASS, PLEASE KEEP CODE SIMPLE, AND WE USE BLUE J...

    *** FOR A BEGINNER LEVEL JAVA CLASS, PLEASE KEEP CODE SIMPLE, AND WE USE BLUE J IN CLASS (IF IT DOESNT MATTER PLEASE COMMENT TELLING WHICH PROGRAM YOU USED TO WRITE THE CODE, PREFERRED IS BLUE J!!)*** ArrayList of Objects and Input File Use BlueJ to write a program that reads a sequence of data for several car objects from an input file. It stores the data in an ArrayList<Car> list . Program should work for input file containing info...

  • Here is a sample run of the tester program: Make sure your program follows the Java...

    Here is a sample run of the tester program: Make sure your program follows the Java Coding Guidelines. Consider the following class: /** * A store superclass with a Name and Sales Tax Rate */ public class Store {      public final double SALES_TAX_RATE = 0.06;      private String name;           /**      * Constructor to create a new store      * @param newName      */      public Store(String newName)      {           name = newName;      }     ...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT