You work for an analytics organization have been tasked with writing a program that simulate a service desk. This servic
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
You work for an analytics organization have been tasked with writing a program that simulate a service desk. This servic
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. The program mustdo the following: The program must first ask the user to run thesimulation or quit the program using a menu. This must be doneusing a function that is called. Upon input of the menu choice, ifthe user inputs a 2, the program will exit, otherwise if the userenters a 1, the program must begin processing the 100 servicerequests. 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 arraysmust be declared and populated: priorities[] - an array of typestring to hold the priority level for each service request. Thesize of the array is indicative of the number of requests in thesimulation (100). The values in the array represent the level ofpriority that will associated with the request (high, medium, orlow). serviceTimes[] - an array of type int to hold the servicetimes of each service request. The size of the array is indicativeof the number of requests in the simulation (100). The values inthe array represent the amount of service time associated with therequest. There are many ways these arrays can be populated, but asa suggestion, follow this logic: Use a loop that repeats based onthe number of service request. Generate a random number for thepriority level then associate a string for the value. For example,1 = high priority, 2 = medium priority, 3 = low priority. Then addthat value to the priority array. Use a function to generate thestring values. In the same loop, 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.