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

Prompt Compose a literacy narrative in which you introduce yourself

Prompt Compose a literacy narrative in which you introduce yourself as a reader and a writer. For example, you could discuss the challenges you face as a new student to literature and what your fears and hopes are for the course. You could also explore how your reading and/or writing

Part 1 How chemotherapy is given: https://www.macmillan.org.uk/cancer-information-and-support/treatment/types-of-treatment/chemotherapy/how-chemotherapy-is-given Students need to

   Part 1  How chemotherapy is given: https://www.macmillan.org.uk/cancer-information-and-support/treatment/types-of-treatment/chemotherapy/how-chemotherapy-is-given Students need to provide a one page reflection on what you learned and how you will apply what you learned into practice. Part 2  Safely Handling Chemotherapy https://www.youtube.com/watch?v=ukJqS_CneH4 Also review  USP 800 PowerPoint Students need provide a one-page reflection on what you

 Practicum Journal Entry I You will submit a journal entry for Weeks 1-3. Journal entries need to connect your previous professional experience with your practice, competencies/concepts in the progr Nursing Assignment Help

 Practicum Journal Entry I  You will submit a journal entry for Weeks 1-3. Journal entries need to connect your previous professional experience with your practice, competencies/concepts in the program, and the literature. Your journal entry should be week-based and sequential so that all journal entries are contained in one file.

For this discussion, describe how you typically communicate nonverbally? Do

For this discussion, describe how you typically communicate nonverbally? Do you have particular or unique patterns of nonverbal communication? What have others said to you about your non-verbal communication? How do you think your non-verbal communication impacts your effectiveness as a communicator? In what ways do you think your non-verbal

Stakeholders are crucial entities that play a role in an

Stakeholders are crucial entities that play a role in an organization’s performance or operations or those affected by the actions undertaken by the organization (Chebbi et al., 2019). In healthcare, stakeholders also comprise individuals, corporations, or any other entity that has a vested interest in medical decisions or evidence upon

Consider a time in your practicum or work setting in

  Consider a time in your practicum or work setting in which a client asked you to share information about yourself.  What did they ask you to share? https://brillianthomeworkassisters.com/learning-goal-im-working-on-a-management-exercise-and-need-a-sample-draft-to-h/management/ How did you respond? Using the NASW Code of Ethics and the readings for this module to inform your thinking, do

Module 03 Content Click here to open a word document

  Module 03 Content Click here to open a word document with the assignment instructions and rubric. NUR2356_Module 03 Assignment_1220.docx Submit your completed assignment by following the directions linked below. Please check the Course Calendar for specific due dates.Save your assignment as a Microsoft Word document. (Mac users, please remember to append the

In this Discussion, you are asked to examine criminal behavior

  In this Discussion, you are asked to examine criminal behavior in terms of its depravity. Which crimes appear to be the most serious? Is shooting someone less depraved than stabbing and beating a person to death? Why? Do you believe that punishments should fit the crimes committed? Consider the

(2305) FRONTLINE | The Vaccine War | PBS – YouTube

 (2305) FRONTLINE | The Vaccine War | PBS – YouTube    After watching this video, address the first question based on your thoughts supported by research. Include with your post the research references in APA style format. Post your reply by Tuesday. After posting begin your textbook reading to complete

PPT presentation feedbacks You can do so by making comments

PPT presentation feedbacks   You can do so by making comments about your peers’ presentations.  1.      BE CLEAR about the group/culture you are making a replay. (ATTACHED) 2.      Include in your comments any missing information that you recommend for the cultural group/population your peers selected.  3. Turnitin (plagiarism program) less than 15%

REFERENCES SHOULD BE OF 5 YRS OR LESS Nursing Assignment Help

REFERENCES SHOULD BE OF 5 YRS OR LESS Expert Solution Preview Introduction: As a medical professor responsible for creating college assignments and evaluating student performance, it is crucial to provide accurate and up-to-date information to medical college students. With references limited to the past five years, the aim is to

Windshield Survey Presentation Nursing Assignment Help

INSTRUCTIONS: 1.Go to and review the Healthy People 2020 initiative.Pay close attention to the objectives, goals, and indicators. 2.Using your city or county public health department or the CDC, choose 3 population or community based problems such as disease, disaster, crimes, accidents, falls etc.. from the topicsoutlined in the website

I started working on it, but did not complete it.

 I started working on it, but did not complete it. This assignment ties into 2 previous assignments that I completed. I will send them completed once I pay. Team Planning Worksheet  Name  PART 1: Review the business problem and team member profiles within the Team Planning Activity.  Then fill in

Lesson 3 Discussion What is the difference between race and

Lesson 3 Discussion What is the difference between race and ethnicity? How could these two sociological concepts factor into present-day issues for minorities? Do you think these present-day issues are indicative of systemic racism? RESOURCES Additional readings/videos regarding treatment and/or history of each group. Native Americans https://courses.lumenlearning.com/wm-introductiontosociology/chapter/native-americans/ https://www.history.com/topics/native-american-history/native-american-timeline https://www.pbs.org/wgbh/roadshow/stories/articles/2020/4/13/early-years-american-indian-boarding-schools Italian

Part 2 – Annotated Bibliography, Action Plan, and Measurement (50

Part 2 – Annotated Bibliography, Action Plan, and Measurement (50 points/ %)  There are three components in Part 2. APA Style Referencing is encouraged. Length requirement: no fewer than 2, no more than 4 pages (Times New Roman, 12 pt, double spaced) Annotated bibliography Locate and use at least four

RESUME

 In Week Two, you chose a job posting and crafted a resume and cover letter tailored to that job (see Chapter 18). After reviewing the feedback from your instructor, make any necessary changes to your resume and cover letter and submit your final, revised cover letter and resume. Remember that