Listing 1. Grouped Functions in a Control Loop

Control_loop_function()
{
  // infinite loop to inspect sprinklers
  // and temperature
  for(;;)
    {
        // inspect sprinklers
        sprinkler_control_functions();
        // inspect temperature controls
        temperature_control_functions();
    }
}
Sprinkler_control_functions()
{
  Inspect_Zone_1();
  Inspect_Zone_2();
  Inspect_Zone_3();
}
Temperature_control_functions()
{
  Inspect_server_room();
  Inspect_reception_room();
  Inspect_lunch_room();
  Inspect_conference_room();
}