Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ coding Part A (Savitch, Q. 8, p.786) Modify or rewrite the Queue class (Display 13.21 through 13.23) to simulate customer arrivals at the Department

c++ coding image text in transcribed
image text in transcribed
Part A (Savitch, Q. 8, p.786) Modify or rewrite the Queue class (Display 13.21 through 13.23) to simulate customer arrivals at the Department of Motor Vehicles (DMV) counter. As customers arrive, they are given a ticket number starting a 1 and incrementing with each new customer. When a customer service agent is free, the customer with the next ticket number is called. This system results in a FIFO queue of customers ordered by ticket number. Write a program that implements the queue and simulates customers entering and leaving the queue. Input into the queue should be the ticket number and a timestamp when the ticket was entered into the queue. A ticket and its corresponding timestamp is removed when a customer service agent handles the next customer. Your program should save the length of time the last three customers spent waiting in the queue. Every time a ticket is removed from the queue, update these times and output the average of the last three customers as an estimate of how long it will take until the next customer is handled. If nobody is in the queue output that the line is empty 0 Code to compute a timestamp based on the computer's clock is given below. The time(NULL) function returns the number of seconds since January 1, 1970, on most implementations of C++ #include int main() long seconds; seconds = static-cast(time (NULL)); cout

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

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

Define and contrast B2B and B2C e-commerce styles.

Answered: 1 week ago

Question

How do virtual communities diff er from physical communities?

Answered: 1 week ago

Question

Is the person willing to deal with the consequences?

Answered: 1 week ago