Question: 1 Problems (PY 1. Write a program to simulate a very busy TA in office hours, according to the following specifications. The TA: (a) The

 1 Problems (PY 1. Write a program to simulate a very
busy TA in office hours, according to the following specifications. The TA:
(a) The TA has a predetermined rate of how fast she can
work. (b) The TA has a predetermined amount of time she can

1 Problems (PY 1. Write a program to simulate a very busy TA in office hours, according to the following specifications. The TA: (a) The TA has a predetermined rate of how fast she can work. (b) The TA has a predetermined amount of time she can hold office hours for. (c) Once the TA starts helping a student, the TA will help the student until their question is answered. (d) The TA can only help one student at a time. The Table: (c) There are only spots for 3 students at a time at the TA's tablc. (f) When a new student comes in and the TA is not busy, the student takes a seat at the table and the TA helps the new student. (g) If a student sitting at the table finishes, the student leaves the resource center entirely. (h) If there are students at the table when the TA's time is done, the TA will help only until the students still sitting at the table are helped (no new students may sit at the table). (i) When a student comes in when a spot at the table is open and the TA is busy, the student takes a seat and waits for the TA to be free. 6) The TA will address the students at the table in the order in which they arrived The Students: (k) The TA's class has an arbitrary (eg random) number of students, but the class size is at least 20. (1) Not every student may come to office hours. (m) Each student knows how long their question will take to be an- swered (n) When a student comes in when a spot at the table is NOT open, the student joins a line within the resource center. (o) When a student is at the front of the resource center line and there is a spot at the table open, the student leaves the resource center line and sits at the table. (P) The student can work on their question while sitting at the table waiting for the TA; the student will work 3 times slower on their question than the regular speed if they were helped by the TA. (q) If a student at the table answers their own question without being helped by the TA, the student leaves. After implementing the specifications above, write code to run the sim- ulation 10 times, outputting the following: How long, on average, the students were waiting in the resource center line. How long, on average, the students who sat at the table were waiting How many students were left in the resource center line when the TA leaves. Your solution should use the Queue abstract data type. In comments, indicate where each specification (referenced by letters) is located. Your main simulation program should be named ofh.py, but you may have other files if you wish. You should match the output format of ofhmatch.txt. If necessary, include a README file to provide the graders information about the purpose each file serves, and how to run the program. Average wait of resource line: # secs Number of students remaining in resource line: # Average wait of table: # secs Number of students TA was not able to help: #

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!