Question: Program in c++. See commented section of code. implement the enqueue function in queuelnk.h add code to the check-out line simulation program (storesim.cpp) to get

Program in c++. See commented section of code.

implement the enqueue function in queuelnk.h

add code to the "check-out line" simulation program (storesim.cpp) to get it up and running. Comments are included in this file to give you further details.

As a general overview, add code to:

Implement the enqueue function according to the comments in queuelnk.h

Implement the check-out line simulation according to the comments in storesim.cpp

Program in c++. See commented section of code. implement the enqueue function

in queuelnk.h add code to the "check-out line" simulation program (storesim.cpp) to

get it up and running. Comments are included in this file to

give you further details. As a general overview, add code to: Implement

the enqueue function according to the comments in queuelnk.h Implement the check-out

Thank you!

I file: storesim cpp Lodified June. 6 2817 Catherine Song // Changed main's return type from void to int. The only universal // return type for main in C++ is void // Simulates the flow of customers through a line in a store // makes use of queues #include iostream #include ionanp> #include cstdlib> #include "queue!nk.h" using namespace std; int main ) // Line (queue) of customers containing the Queuecint custQ; / time that each customer arrived and // joined the line int simLength, minute, timeArrived waitTime, totalserved = , totallait = 0, maxwait = , // Length of simulation (minutes) // Current minute // Time dequeued customer arriv // How long dequeued customer waited // Total customers served // Total waiting time // Longest wait coutendl simLength for ( minute ; minute simLength ; minute++ ) if (custQ.isEmpty)) // Add code here to do the following /* 1) dequeue the first customer and capture its return /in timeArrived // 2) increment totalserved // 3) calculate the waittime of the customer // 4) add the waitTime of the customer to totalwait 15) update maxWait if this custoner waited langer than any previous customer switch ( rand() % 4 ) // The number generated above will be between 8 and 3 I If B or 3, then no customers will be added, If 2, then Z // customers will be added. If 1, then one customer will be added case 8: case 3 : nunArrivals = 0; break; case 1 : nunArrivals = 1; break; case 2 : numArrivals = 2 for ( int j = ; j #include cstdlib> #include "queue!nk.h" using namespace std; int main ) // Line (queue) of customers containing the Queuecint custQ; / time that each customer arrived and // joined the line int simLength, minute, timeArrived waitTime, totalserved = , totallait = 0, maxwait = , // Length of simulation (minutes) // Current minute // Time dequeued customer arriv // How long dequeued customer waited // Total customers served // Total waiting time // Longest wait coutendl simLength for ( minute ; minute simLength ; minute++ ) if (custQ.isEmpty)) // Add code here to do the following /* 1) dequeue the first customer and capture its return /in timeArrived // 2) increment totalserved // 3) calculate the waittime of the customer // 4) add the waitTime of the customer to totalwait 15) update maxWait if this custoner waited langer than any previous customer switch ( rand() % 4 ) // The number generated above will be between 8 and 3 I If B or 3, then no customers will be added, If 2, then Z // customers will be added. If 1, then one customer will be added case 8: case 3 : nunArrivals = 0; break; case 1 : nunArrivals = 1; break; case 2 : numArrivals = 2 for ( int j = ; j

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!