The temperature in an apartment must be kept between 18°C and 20°C. If the
temperature reaches 22°C then the fan is switched on; if the temperature reaches
16°C then the heater is switched on, otherwise the fan and the heaters are switched
off.
>>51241589
The following library routines are available:
• GetTemperature
• FanOn
• FanOff
• HeaterOn
• HeaterOff
Write an algorithm, using pseudocode or a flowchart, to keep the temperature at
the right level.
>>51241589
>>51241596
do your own homework
>>51241618
fuck that
If you're this program illiterate, you may as well just quit while you're ahead, or pay someone to do it for you.
please tell me you can do this yourself.
>>51241701
>>51241669
im testing /g/ , :'^)
>>51241589
fans don''t actually cool a room
>>51241589
IF hot THEN cool it down
IF cold THEN heat it up
ELSE do nothing
psuedocode is easy!
>>51241716
> fans don't actually cool a room
kek m8
>>51241589
>The temperature in an apartment must be kept between 18°C and 20°C
Alright
>If the temperature reaches 22°C
Can't happen. Apartment must be kept between 18°C and 20°C
>if the temperature reaches 16°C
Also can't happen. Apartment must be kept between 18°C and 20°C
>>51241776
>Apple temperature management unit
>simply leaves any room not conforming to the configured temperature range
>>51241589
if (GetTemperature > 15)
if GetTemperature < 21)
HeaterOn
FanOff
else
FanOn
HeaterOff
else
FanOff
HeaterOff
>>51241748
No, he's right, unless you open a window, fans will add to the temperature. Law of thermodynamics and all that.
What it does do is make you feel colder by moving the air around you.
Also, I wish my freaking homework was this easy. First year CS, and I'm failing (40%). Got a test on Monday, worth 15%. I'm fucked.
>>51241589
Why use pseudocode when you can just make a state machine? You don't need a computer for this.
>>51241875
Everything is better with computers.
>>51241873
>What it does do is make you feel colder by moving the air around you.
feels good senpai
>>51241748
How can fans be real if our eyes aren't real?
void getsCalledEverySecond {
if(getTemperature() >= 22) {
HeaterOff(); //to make sure
FanOn();
} else if(getTemperature() <= 16 ) {
FanOff(); //to make sure
HeaterOn();
} else {
HeaterOff();
FanOff();
}
}