Solve this problem with C++ in Visual Studio using priorityqueue.
The people that run the Department of Motor VehiclThe people that run the Department of Motor Vehicles (DMV) have a problem. They are concerned that people do not spend enough time waiting in lines to appreciate the privilege of owning and driving an automobile. The current arrangement is as follows: When people walk in the door, they must wait in a line to sign in. Once they have signed in, they are told either to stand in line for registration renewal or to wait until they are called for license renewal Once they have completed their desired transaction, they must go and wait in line for the cashier When they finally get to the front of the cashier’s line, if they expect to pay by check, they are told that all checks must get approved. To do this, it is necessary to go to the check approver’s table and then reenter the cashier’s line at the end Your job is to write an event driven simulation program to help the DMV gather statistics. Each line of input contain A desired transaction code (L for licence, R for registration) A method of payment code (S for cash, C for check) An arrival time (integer) A name (assume no spaces) Write the specifics ofeach event (when, who, what and so on). Then display these final statistics Total number of license renewals and the average time spent at the DMV (arrival until completion o payment) to renew a license Total number of registration renewals and the average time spent to renew a registration Incorporate the following details into your program Define the following events: arrive, sign in, renew license, renew registration, and cope with the cashier (make payment or final out about check approval In case of a tie, let the order ofevents be determined by the list just given e. arrivals have the highest priority) Assume the various transactions take the following amounts of time o Sign in 10 seconds o Renew license 90 seconds o Register car: 60 seconds 30 seconds o See cashier (payment): o See cashier (check not approved): 10 seconds As ridiculous as it may seem, the people waiting for license renewal are called in alphabetical order. Note, however, that people are not pushed back once their transactions have started. For the sake of this simulation, you can assume that checks are approved instantly. Therefore the rule arriving at the front of the cashier’s line with a check that has not been approved is to go to the back of the cashier’s line with a check that has been approved Show transcribed image text