Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python. Part II: Help Desk Simulator (3 points) In this problem you will write a function that simulates an IT help desk work session.

image text in transcribed

In python.

Part II: Help Desk Simulator (3 points) In this problem you will write a function that simulates an IT help desk work session. An IT technician opens the door for a free repair session, and, realizing there is already a long line of clients waiting outside, he starts taking people right away Write a function session.simulator ) that takes two arguments, in this order: 1. clients: a list of integers in which each integer represents the minutes required to resolve a particular client's technical problem. 2. regular: the amount of regular time (in whole minutes) that the technician planned to stay for this help In addition, the IT technician helps clients by the following rules: CSE 101 -Fall 2017 Lab #5 Page 2 First let's understand how time works in this problem. For simplicity, say the regular help session is 3 minutes long. If the first client takes 3 minutes, then the regular session is considered ended. Any additional time that this client needs or that other clients need will be reduced according to the rules described below . The technician takes clients in order one-by-one: first come, first served. You may assume that no new clients arrive once the session has started Because the technician is nice, he will help all the clients even when the session has officially ended However, any clients he takes after the regular session time has ended will receive only half of the normal time that the client would have required. Note: you must use integer division to compute the reduced time amount. This means that if the normal time required is 7, then the shortened time will be (the normal time required // 2) (7 // 2) -3. When a client arrives during regular time but needs more time than the technician has remaining in the regular session, the client will receive all of the remaining time in regular session, plus half of the excess time the client wanted. For example, suppose a client needs 10 minutes of the technician's time but there are only 4 minutes remaining. The client will be given all 4 minutes of the remaining time plus half of the excess 6 minutes that he wanted: 4(10-4)//2-7minutes total. Your function should keep running until all clients have been helped. The function should return the total time spent spent by the technician (in minutes). You may assume that all arguments will be valid. However, it is possible that no client shows up for the help session. In that case, the function should simply return 0 (helped nobody) Important: Please keep in mind that we are using integer divisions throughout this function. Examples Function Call session simulator ([5, 5, 10) session.simulator ([1, 5, 4, 111, 10)15 session simulator ([5, 7, 5, 6], 20) 21 Return Value 10

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

How many core competencies do most start-ups have?

Answered: 1 week ago

Question

What is Internal Control? Who is responsible for this?

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago