Question: Queue Data Structure A small supermarket has at the output two payment boxes. There are 10 shopping carts on the premises. Write program that simulate

Queue Data Structure

A small supermarket has at the output two payment boxes. There are 10 shopping carts on the premises. Write program that simulate the operation, following the following rules:

If when a customer arrives, there is no shopping cart available, wait until it is available.

No customer gets impatient and leaves the supermarket without going through any of the lines of the boxes.

When a customer completes their purchase, it is placed in the queue of the box that there are fewer people, and it is not changed queue.

As soon as a customer pays at the checkout, their shopping cart becomes available.

Represent the list of shopping carts and output boxes by means of queues.

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 Programming Questions!