Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python 3 Output: Servers and customers Servers are stored in a stack, where the first server in the textarea is the the last server used.
python 3
Output:
Servers and customers Servers are stored in a stack, where the first server in the textarea is the the last server used. It is a requirement that you use a stack of servers. Customers are stored in a queue, where the first customer in the textarea is the first customer used. It is a requirement that you use a queue of customers. Each server and customer has a Name and a Number associated with it. The Name is used for printing and the Number is the amount the server can serve or the customer needs served. Each will have a separate text area. What to do (inside a loop) "load" the first server (at the bottom) and the first customer(at the top): If they are the same, report that and remove both from their respective areas and move on to the next two. If the server can serve more than the customer requires, the server completely serves the customer and reduces the Number on that server by the amount served. Remove the customer and move on to the next customer. If the customer needs more served than the server can serve, the customer completely uses up the server and reduces the Number on that customer by the amount served. Remove the server and move on to the next server. When to end (the loop condition) If all the servers are done serving, report that there are no more servers. If all the customers are done being served, report that there are no more customers. Servers and Customers Enter servers below. Servers work like a stack, the last server Enter customers below. Customers work like a queue, in the column is the first one used. You can picture a waiting the first customer in the column is the first one used. room were the servers enter and a pushed further in the room You can picture it like a line outside a trendy by new servers. Name numberPresent Exit serverone i erver Fire 20 customer 2 customer 12 Servers and Customers Loaded server: serverFive Loaded customer customer serverFive serves custom Loaded customer customer serverFive serves customer(12) No more Customers Entry/Exit Entry for the Servers and customers Servers are stored in a stack, where the first server in the textarea is the the last server used. It is a requirement that you use a stack of servers. Customers are stored in a queue, where the first customer in the textarea is the first customer used. It is a requirement that you use a queue of customers. Each server and customer has a Name and a Number associated with it. The Name is used for printing and the Number is the amount the server can serve or the customer needs served. Each will have a separate text area. What to do (inside a loop) "load" the first server (at the bottom) and the first customer(at the top): If they are the same, report that and remove both from their respective areas and move on to the next two. If the server can serve more than the customer requires, the server completely serves the customer and reduces the Number on that server by the amount served. Remove the customer and move on to the next customer. If the customer needs more served than the server can serve, the customer completely uses up the server and reduces the Number on that customer by the amount served. Remove the server and move on to the next server. When to end (the loop condition) If all the servers are done serving, report that there are no more servers. If all the customers are done being served, report that there are no more customers. Servers and Customers Enter servers below. Servers work like a stack, the last server Enter customers below. Customers work like a queue, in the column is the first one used. You can picture a waiting the first customer in the column is the first one used. room were the servers enter and a pushed further in the room You can picture it like a line outside a trendy by new servers. Name numberPresent Exit serverone i erver Fire 20 customer 2 customer 12 Servers and Customers Loaded server: serverFive Loaded customer customer serverFive serves custom Loaded customer customer serverFive serves customer(12) No more Customers Entry/Exit Entry for theStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started