Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use the python to answer this, thanks In this problem you will write a function that simulates an IT help desk work session. An

Please use the python to answer this, thanks image text in transcribed
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 O that takes two arguments, in this order: I. 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 session In addition, the IT technician helps clients by the following rules: . 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 arive 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 wil be (the normal time required /1 2)-(711 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 7 minutes 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 (I5, 5, 10) session simulator(1, 5, 4, 111, 10) 15 session simulator (15, 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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

=+Where do you want to live and work?

Answered: 1 week ago

Question

=+1 Where are the best places in the world to live (and work)?

Answered: 1 week ago