**DONT USE VECTORS PLEASE
You work for an analytics organization have been tasked withwriting a program that simulate a service desk. This service deskshould be able to service 100 customers that can have one of threedifferent priorities (high, medium, and low). The duration for anycustomer is a random number (between 5 minutes and 8 minutes). Codea modular program that uses parallel arrays to store prioritylevels and service times for 100 service requests. T
he program must do the following: The program must first ask theuser to run the simulation or quit the program using a menu. Thismust be done using a function that is called. Upon input of themenu choice, if the user inputs a 2, the program will exit,otherwise if the user enters a 1, the program must begin processingthe 100 service requests.
The program must use loops and random numbers to generatepriority level (high, medium, or low) as well as the service time(between 5 and 8 minutes) for each request in parallel arrays.These arrays must not be declared globally.
The following arrays must be declared and populated:
priorities[] - an array of type string to hold the prioritylevel for each service request. The size of the array is indicativeof the number of requests in the simulation (100). The values inthe array represent the level of priority that will associated withthe request (high, medium, or low).
serviceTimes[] - an array of type int to hold the service timesof each service request. The size of the array is indicative of thenumber of requests in the simulation (100). The values in the arrayrepresent the amount of service time associated with the request.There are many ways these arrays can be populated, but as asuggestion, follow this logic:
Use a loop that repeats based on the number of service request.Generate a random number for the priority level then associate astring for the value. For example, 1 = high priority, 2 = mediumpriority, 3 = low priority. Then add that value to the priorityarray. Use a function to generate the string values. In the sameloop, populate the service times array.
Generate a random number between 5 and 8 minutes, then add thatvalue to the service times array. Use a function to generate theservice times. Once both arrays are populated, the program mustdisplay the stats for the service desk. This includes displaying alisting of all service requests generated along with the associatedservice time for each service request. Then display a count of thenumber of requests within each priority along with the averageservice time of requests in each priority level. This must be doneby calling a function that accepts both arrays as well as thenumber of service requests. Once the simulation has finishedprocessing, display the menu and allow for the user to makeselections until the user chooses to quit the program via a menuchoice entered in step 1 or 2. In addition to the main() function,declare prototypes, write function definitions and correctly callthe following functions: mainMenuChoice() - function must allow theuser to choose whether or not they will run the simulation bydisplaying a menu. Validate the user input so that the user mustenter either 1 or 2. If the user enters an invalid menu choice,they must be given an unlimited number of chances to enter a validmenu choice. The function must return the validated menu choice.generatePriority() - function must generate a string thatrepresents the priority level of the service request. Each servicerequest can be either high, medium, or low priority. (Your programshould randomly allocate this priority to each service.) Thefunction must return a string that represents the priority level ofthe service request. generateServiceTime() – function must randomlygenerate and return a value that represents the service time foreach request. Each service request can need any time to be servicedbetween 5 and 8 minutes. (Your program must randomly allocate aninteger time to each service request.) serviceDeskStats() –function must accept the arrays that contain the priorities,service times, as well as an integer that represents the number ofrequests in the simulation as arguments. Then the function mustdisplay a list of all of the service requests generated in thesimulation with their priority level and the service time for eachrequest. Finally, display the total amount of requests within eachpriority level along with the average service time within eachpriority level.
**DONT USE VECTORS PLEASE You work for an analytics organization have been tasked with writing a program that simulate a
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am