Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Customers with a priority value higher than other existing customers should be placed in front of them. This issimulated by utilizing a Max Heap to

Customers with a priority value higher than other existing customers should be placed in front of them. This issimulated by utilizing a Max Heap to implement your priority queue. The only exception to this is for thecustomer in the front of the line (the one currently being serviced). If a new customer is added to theline with a higher priority than the front customer, the new customer should not be put in front of thecustomer being serviced only those that are also waiting in line. The store simulation with regards to theservice time of customers, probability that new customers show up, and program output will be the same as it

was for the first program. The program (driver) should simulate 60 minutes of activity at the store. Each iteration of your program shouldrepresent one minute. At each iteration (minute), your program should do the following: Check to see if new customers are added to the queue. There is a 25% chance that new customersshow up (need to be added to the queue) every minute. This does not mean you should add acustomer every four iterations, but rather each iteration should have its own 25% chance. Update the customer object currently being serviced (if one exists). This will be the customer object atthe front of the queue. If the customer has been completely serviced, remove them from the queue. During execution, your program should output the following information: When a new customer is added to the queue, output, New customer added! Queue length is now X

where X is the size of the queue after the new customer has been added. When a customer has been completely serviced, output, Customer serviced and removed from thequeue. Quest length is now X where X is the size of the queue after the customer has been removed. At the end of each iteration (minute), output, --------------------------------------------------- to visuallyidentify the passing of time. When your simulation ends, your program should also output the following information: Total number of customers serviced Maximum line length during the simulation

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_2

Step: 3

blur-text-image_step3

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

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

ISBN: 3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

Which statement does not apply to the lock and key theory

Answered: 1 week ago

Question

Question Can life insurance be used in a Keogh (HR 10) plan?

Answered: 1 week ago