If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Challenge: Wait times

Instructions

Step 1

Simulate a full shift

Alicia’s family owns a popular quick service restaurant. Her uncle staffs one cashier on a shift, yet the line of customers often wraps around the block. How can Alicia reduce customer wait times?

The current program simulates just one minute of service, but the restaurant serves from 12-5pm every day.

  • Add a for loop that simulates service for the total number of minutes in the 5 hour shift.
  • Make sure to print the number of customers waiting in each state at the end of each minute.

Consider which lines of the program should only run once and and which lines should repeat every minute the restaurant is open.

Code editor

Code files

Output