Special Instructions 1. You will have 5 hours to complete the assignment. The assignment is actually 4 hours but an extr

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Special Instructions 1. You will have 5 hours to complete the assignment. The assignment is actually 4 hours but an extr

Post by answerhappygod »

Special Instructions 1 You Will Have 5 Hours To Complete The Assignment The Assignment Is Actually 4 Hours But An Extr 1
Special Instructions 1 You Will Have 5 Hours To Complete The Assignment The Assignment Is Actually 4 Hours But An Extr 1 (226.59 KiB) Viewed 85 times
Note: Solve in C++
Sample Run...

Special Instructions 1. You will have 5 hours to complete the assignment. The assignment is actually 4 hours but an extra hour has been added to cover potential problems, allow for uploading and capturing a screen shot of the submission confirmation page (if needed). 2. Filename: Exam2Lastname.cpp (where Lastname is your last name i.e. Exam2Smith.cpp). Incorrect file names will count as 1 minor error. 3. Submit only your source code file (This is the file with the ".cpp" extension - NOT the ".exe" file). 4. You can only submit twice. The last submission will be graded. 5. This exam covers concepts in Chapters 2-7 (up to arrays) only. The use of advanced code from other Chapters (including vectors) in the book will count as a major error. 6. Refer to the Error Definitions file in this week's Brightspace Module for a list of Major and Minor Errors. 7. This assignment link closes promptly at 5:00 PM on 07/11/2022. Late work and email submissions will NOT be accepted. No make-ups or re-takes will be granted. Program Description You work for an analytics organization have been tasked with writing a program that simulate a service desk. This service desk should be able to service 100 customers that can have one of three different priorities (high, medium, and low). The duration for any customer is a random number (between 5 minutes and 8 minutes). Code a modular program that uses parallel arrays to store priority levels and service times for 100 service requests. The program must do the following: 1. The program must first ask the user to run the simulation or quit the program using a menu. This must be done using a function that is called. 2. Upon input of the menu choice, if the user inputs a 2, the program will exit, otherwise if the user enters a 1, the program must begin processing the 100 service requests. 3. The program must use loops and random numbers to generate priority 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 priority level for each service request. The size of the array is indicative of the number of requests in the simulation (100). The values in the array represent the level of priority that will associated with the request (high, medium, or low). ▪ service Times[] - an array of type int to hold the service times of each service request. The size of the array is indicative of the number of requests in the simulation (100). The values in the array represent the amount of service time associated with the request. ▪ There are many ways these arrays can be populated, but as a suggestion, 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 a string for the value. For example, 1 = high priority, 2 = medium priority, 3 = low priority. Then add that value to the priority array. Use a function to generate the string values. ▪ In the same loop, populate the service times array. Generate a random number between 5 and 8 minutes, then add that value to the service times array. Use a function to generate the service times. 4. Once both arrays are populated, the program must display the stats for the service desk. This includes displaying a listing of all service requests generated along with the associated service time for each service request. Then display a count of the number of requests within each priority along with the average servic time of requests in each priority level. This must be done by calling a function that accepts both arrays as well as the number of service requests. 5. Once the simulation has finished processing, display the menu and allow for the user to make selections until the user chooses to quit the program via a menu choice entered in step 1 or 2.
In addition to the main() function, declare prototypes, write function definitions and correctly call the following functions: . mainMenuChoice() - function must allow the user to choose whether or not they will run the simulation by displaying a menu. Validate the user input so that the user must enter either 1 or 2. If the user enters an invalid menu choice, they must be given an unlimited number of chances to enter a valid menu choice. The function must return the validated menu choice. generate Priority() - function must generate a string that represents the priority level of the service request. Each service request can be either high, medium, or low priority. (Your program should randomly allocate this priority to each service.) The function must return a string that represents the priority level of the service request. • generate Service Time() function must randomly generate and return a value that represents the service time for each request. Each service request can need any time to be serviced between 5 and 8 minutes. (Your program must randomly allocate an integer time to each service request.) • service DeskStats() function must accept the arrays that contain the priorities, service times, as well as an integer that represents the number of requests in the simulation as arguments. Then the function must display a list of all of the service requests generated in the simulation with their priority level and the service time for each request. Finally, display the total amount of requests within each priority level along with the average service time within each priority level. Other Notes: • Program Output and Prompts MUST MATCH the formatting of the sample runs EXACTLY. • No Global data can be used in the program • Functions MUST be written and called as instructed above. Only the functions that are instructed are permitted. • Ensure that the random generated data is different every time the program is executed. • CODE MUST BE ADEQUATELY COMMENTED
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply