Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Amusement Park Programming Project Project Outcomes 1. Use the Java selection co

ID: 3769629 • Letter: A

Question

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 © 2014 Laureate Education, Inc. Page 2 of 5 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 It more to the question on the next to post

Explanation / Answer

Here is the code for the class AdmissionTicket. If you have any further queries, just get back to me.

import java.util.*;
class AdmissionTicket
{
long ticketNumber;
String category;
String ticketHolder;
Date date;
double price;
boolean purchaseStatus;
AdmissionTicket(long tNo, String cat, String tHold, Date d, double prc, boolean pStat)   //Constructor with parameters.
{
ticketNumber = tNo;
category = cat;
ticketHolder = tHold;
date = d;
price = prc;
purchaseStatus = pStat;
}
void setPrice(double prc)   //Sets the price to given value.
{
price = prc;
}
void changePurchaseStatus(boolean newStatus) //Changes the purchase status.
{
purchaseStatus = newStatus;
}
long getTicketNumber()   //Accessor functions.
{
return ticketNumber;
}
String getCategory()
{
return category;
}
String getTicketHolder()
{
return ticketHolder;
}
Date getDate()
{
return date;
}
double getPrice()
{
return price;
}
boolean getPurchaseStatus()
{
return purchaseStatus;
}
public String toString()
{
String output = String.format("Ticket Number: %l Category: %s Ticket Holder Name: %s Purchase Date: %s Price: %.2d PurchaseStatus %d ",ticketNumber, category, ticketHolder, date, price, purchaseStatus);
return output;
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote