Include stored state in the software specification

A ventilation controller uses the current room temperature and the fan's previous state, meaning its stored ON or OFF condition, to determine its next state. Its specification is:

  • At temperatures of 30 ∘C30\ ^\circ\text{C} or higher, the next state is ON.
  • At temperatures of 26 ∘C26\ ^\circ\text{C} or lower, the next state is OFF.
  • Strictly between these temperatures, the next state equals the previous state.

Complete the expected outputs using ON or OFF. Each row is an independent test case; use the previous state supplied in that row.

Test caseTemperature (°C)Previous stateNext state
A28ON
B28OFF
C32OFF
D24ON
E29OFF

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Translating Engineering Problems into Software Solutions Questions: