Question
Draw a state diagram for a thermostat. Your diagram will show the state of the variable Thermostat.status. The variable has the states off and on.
Draw a state diagram for a thermostat. Your diagram will show the state of the variable Thermostat.status. The variable has the states off and on. The messages Thermostat.turnOn() and Thermostat.turnOff() manipulate this variable when under manual control. In addition, if the variable Thermostat.temperature rises above 80 the thermostat is automatically turned off, and if the temperature falls below 60 the thermostat is automatically turned on. When the thermostat is turned on or off manually, it remains under manual control only, until the operation Thermostat.resumeProgram() returns the thermostat to responses to both manual and automatic state changes. The Boolean variable Thermostat.manual reflects whether the thermostat is under manual only, or automatic and manual control. Lastly, the thermostat is initially off.
Step 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