Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

It is to find queue data structures being used in simulation programs that model real-world events and track their behavior over time. A theater manager

image text in transcribed
It is to find queue data structures being used in simulation programs that model real-world events and track their behavior over time. A theater manager wants a program that simulates a line of box office customers waiting to see one of two movies, Movie A or Movie B. The manager knows that if the waiting line gets too long, newly arriving customers will turn away perhaps to find another theater. The desired program will simulate the activity in the waiting line over a 30-minute period, concluding with a report of the following: the number of paid customer for Movie A, number of paid customers for Movie B and the number of customers who were turned away because the line was too long. The manager's experience suggests that the average time to serve one customer is ten seconds, and during those ten seconds, the probability is 70 percent that a new customer will join the waiting line. To simulate a 30-minute time span, the program will cover 180 ten-second intervals. In each ten second interval, one customer will be served from the front of the line and, with a 70 percent probability, one customer will join the rear of the line. For this simulation, the textbook's queue package is available with the operations we have discussed in class. The simulation program should use a "bounded" queue (Why?). The program simulates a customer entering the waiting by enqueueing the string "Movie A" or Movie B", the customer's choice of movies. Each "Movie A" or "Movie B is obtained by generating a random integer of 0 (for Movie A) or l (for Movie B). This programming assignment extends the theater simulation discussed in class. The theater manager now wants a more realistic simulation of the waiting queue. Expand the theater program to accommodate the following changes. Use a parameterized constructor to create a queue of the size in by the user. Instead of starting the 30-minute simulation with an empty queue, pre-fill the queue with some number of customers before starting the main loop. Prompt the user for this number. Input the service time, and probability of two new customers getting in line. The program will conclude by displaying the average queue length over all ten-second intervals, the cash register receipts for Movie A (at $9.50 per ticket and Movie B (at $10.00 per ticket), and the number of customers who were turned away. What about finding the queue length? What does it mean, and how can it be determined? Will we need an addition method in the queue class? It is to find queue data structures being used in simulation programs that model real-world events and track their behavior over time. A theater manager wants a program that simulates a line of box office customers waiting to see one of two movies, Movie A or Movie B. The manager knows that if the waiting line gets too long, newly arriving customers will turn away perhaps to find another theater. The desired program will simulate the activity in the waiting line over a 30-minute period, concluding with a report of the following: the number of paid customer for Movie A, number of paid customers for Movie B and the number of customers who were turned away because the line was too long. The manager's experience suggests that the average time to serve one customer is ten seconds, and during those ten seconds, the probability is 70 percent that a new customer will join the waiting line. To simulate a 30-minute time span, the program will cover 180 ten-second intervals. In each ten second interval, one customer will be served from the front of the line and, with a 70 percent probability, one customer will join the rear of the line. For this simulation, the textbook's queue package is available with the operations we have discussed in class. The simulation program should use a "bounded" queue (Why?). The program simulates a customer entering the waiting by enqueueing the string "Movie A" or Movie B", the customer's choice of movies. Each "Movie A" or "Movie B is obtained by generating a random integer of 0 (for Movie A) or l (for Movie B). This programming assignment extends the theater simulation discussed in class. The theater manager now wants a more realistic simulation of the waiting queue. Expand the theater program to accommodate the following changes. Use a parameterized constructor to create a queue of the size in by the user. Instead of starting the 30-minute simulation with an empty queue, pre-fill the queue with some number of customers before starting the main loop. Prompt the user for this number. Input the service time, and probability of two new customers getting in line. The program will conclude by displaying the average queue length over all ten-second intervals, the cash register receipts for Movie A (at $9.50 per ticket and Movie B (at $10.00 per ticket), and the number of customers who were turned away. What about finding the queue length? What does it mean, and how can it be determined? Will we need an addition method in the queue class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

3. What are potential solutions?

Answered: 1 week ago