Question: using c++ and data structure Dubai port is having trouble keeping up with the incoming cargo ship traffic. They have come up with a priority

using c++ and data structure

Dubai port is having trouble keeping up with the incoming cargo ship traffic.

They have come up with a priority system where ships would be allowed in the

port according to which one has the maximum priority as calculated by the

following formula:

priority=#containers * (1+days waiting)

The port is able to unload five ships per day.

Your task is to create a simulator of the port operation. Your program should

generate a given number of ships (as specified in the command line) each with

a random number of containers in the range of [100, 1000]. Your program

should then print out the order that these ships will come into the port, and the

min, max and average waiting time.

An example of how the program should be called:

$ portSim 10 // should simulate 10 ships

Order : 0 2 5 6 7 8 9 1 4 3

Min : 0

Max : 1

Average : 0.5

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!