Don’t use chegg or coursehero Programming Assignment 7 – Theme

 Don’t use chegg or coursehero

Programming Assignment 7 – Theme Parks and Threads   
Amusement parks are a lot of fun, but everyone agrees the worst part of the experience is waiting.
Some companies invest in a lot of clever systems to help manage and control their lines more efficiently.
To see behind the scenes at how Disney does this, check out:
https://www.nytimes.com/2010/12/28/business/media/28disney.html
Now we’re going to create our own command station that uses threads to activate and track rider
movement throughout a bustling amusement park.  
Program Requirements
• Create a new class called “ThemePark.” Inside it, put your main program. This program will
manage and monitor all the theme park rides in the park. ThemePark should extend Thread.
• Create a new class called “Amusement.” This class should extend Thread. This class will have the
following variables and methods to access them. (Remember to use proper Object-Oriented
design in its creation):
o A ride type (e.g., “Bumper Cars,” “Rollercoaster,” “Carousel”)
o A waiting Queue (those waiting in line)
o A ride Queue (those actively riding the ride)
o A maximum capacity (controls how many people can ride)
o A ride duration (how long the ride takes)
o A running Boolean (is the ride running? True/false) – initially set to false
• Override the run() function inside your “Amusement” class. This function should do the
following
o Set the “running” state to true
o Sleep for x seconds (where x is the ride’s duration)
o When finished, set the “running” state to false
• Inside ThemePark, instantiate five Amusement objects. Assign each Amusement a type,
capacity, and duration. Put the capacity at around 20–60 riders at one time
o Create a new Queue called “attendees.” Fill this with unique numbers from 1–1000
o Start each of the Amusement threads. Have ThemePark check every second on the
“running” status of each Amusement. If an Amusement is not running, first put all of
the riders in the Amusement’s ride Queue into the “attendees” Queue. Put the
maximum number of riders from the ride’s waiting Queue into the ride Queue. Finally,
take a set number of riders from the “attendees” Queue and place them in the
Amusement’s waiting Queue

Note: here is a diagram to help you make sense of the flow of riders into the various
Queues:  

 
• If the user types “END,” stop all of the threads and place the riders back into the attendees
Queue. Then exit the program

Include appropriate comments throughout your code. Remember to use standard Java naming
conventions. Put your name and description of the program in the comments at the top. Submit your
ThemePark, Amusement, and all associated project Java and class files, as well as a screenshot of it in
operation on your computer. Package all of these in a zip file and name the submission in the format:
NAME_COURSE_ASSIGNMENT_DATE.zip
Submission is due by 11:59 p.m. ET.  
• If the user types “END,” stop all of the threads and place the riders back into the attendees
Queue. Then exit the program

Include appropriate comments throughout your code. Remember to use standard Java naming
conventions. Put your name and description of the program in the comments at the top. Submit your
ThemePark, Amusement, and all associated project Java and class files, as well as a screenshot of it in
operation on your computer. Package all of these in a zip file and name the submission in the format:
NAME_COURSE_ASSIGNMENT_DATE.zip 

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

evidence based therapeutic paper

Description  Write a 750-1,500 word APA scholarly paper by watching a formal interview conducted by any professional reporter, journalist or talk show host. a. Briefly describe the type of interview and the topic discussed. b. Name 3 therapeutic communication techniques used by the speaker/reporter/host and describe with verbatim examples with

ABC Corporation’s Network Description

Your assignment is to complete a wireless network design for a small company. You will place a number of network elements on the diagram and label them appropriately. A network diagram is important to communicate the design features of a network between network administrators, system administrators and cyber-security analysts. It

Finding the Details “If you know the enemy and know

 Finding the Details “If you know the enemy and know yourself, you need not fear the resultof a hundred battles. If you know yourself but not the enemy, for every victory gained youwill also suffer a defeat. If you know neither the enemy nor yourself, you will succumb in everybattle.”

Leader chosen: MAHATMA GANDHI Leader Analysis Paper #1 During this

Leader chosen: MAHATMA GANDHI   Leader Analysis Paper #1 During this course, you will have the opportunity to select a leader to analyze in terms of each addressed topic.  In order to do so, you will need to identify a leader for which there is substantial information about his or

As you can see, each theory makes certain assumptions about

  As you can see, each theory makes certain assumptions about the origins of personality. Depending on the theory, the focus can be on unconscious motivators, unmet needs, social forces, acceptance by your parents, biology, or your predominant tendencies or traits. If you find yourself following only one particular theory

Assignment Directions: Discuss Role Play, Threat Emulation, and Operational Impact

  Assignment Directions: Discuss Role Play, Threat Emulation, and Operational Impact In a word document, discuss the assigned topic consisely in approximately ten sentences. General requirements and instructions to complete your assignment Use the IEEE format to cite any material you take directly from a source or paraphrase. Type your

ORGANIZATIONAL STRUCTURE

Description Companies organize themselves in various ways in order to communicate the goals of the organization, make decisions to implement those goals, and allocate work to carry out the decisions. Organizations can be hierarchical or flat, bureaucratic or flexible, planned or ad hoc. An important part of being successful in

Competencies Assess the importance of performance management within an organization.

Competencies Assess the importance of performance management within an organization. Distinguish best practices of an effective performance management system within an organization. Develop performance appraisal techniques for an organization. Evaluate the impact of employee engagement on organizational performance. Evaluate the dynamics of a performance-driven organizational culture. Design a compliant performance

Recruitment and the hiring process

Annotated Bibliography Instructions: Based upon your choice of topic, perform scholarly research at the library. Research Librarians can help you with electronic databases to find authoritative resources to use in developing your annotated bibliography. There are a number of business-related databases for scholarly research. You are required to find a

Scenario You have been asked by your company to talk

Scenario You have been asked by your company to talk to a group of political leaders here in the United States. As you scan the crowd, you see only a few women in the audience. One week later, you give the same talk in Sweden and find there are a

What all tests have in common is that we need

What all tests have in common is that we need to formulate a null and alternative hypothesis before we analyze any data. The alternative hypothesis typically represents the effect, or result, we believe is true, and the null hypothesis represents a comparison point. For this discussion, I would like you

We would all agree that there is some level of

We would all agree that there is some level of stress in everyone’s life. The stress response may be quite similar for each of us; however, there are distinct differences in the way women and men experience and respond to stress. In your exploration of these concepts, respond to the

In the space below write a 2- 3 pages analysis

   In the space below write a 2- 3 pages analysis that includes the following: • Explanation for the relationship between academic integrity and writing • Explanation for the relationship between professional practices and scholarly ethics  • Cite resources that support your arguments, being sure to use proper APA formatting. 

One of the basic ways to interact with the hardware

One of the basic ways to interact with the hardware on the device is to retrieve data about the device itself.  Knowing how to interact with the hardware on the device is an important step toward being able to create apps that take advantage of the full promise of mobile

Performance Management at DIY Stores

COURSEWORK ASSIGNMENT   Academic Year 2018/19     Module Code:               BHM347   Module Name:               HRM: Assessment Performance and Reward   Coursework Title:   Group assignment: HRMB students. Case study – Performance Management at DIY Stores   Task Details/Description: Carefully analyse the case of DIY Stores and write a group report