Smart Thermostat exercise
Tmeadows97

Write a program for your smart thermostat. Do the following using a temperature, isRaining, and isOn property,

If the temperature is less than 68 degrees or it is raining, the Air Conditioning should be turned off. Otherwise the Air Conditioning should be turned on.

Try different combinations of temperatures and weather conditions (raining vs not raining) to make sure your thermostat works correctly.

Use a print statement to check the air conditioning's status.

// My code, as is, works but it makes the constant labels seem strange. Specifically, the isOn constant. I'm also getting an error like other people where it doesn't match my teachers answer which is:
( false| true )


Any advice is much appreciated. Thank you! This is Swift btw.

You are viewing a single comment. View All
CodeLongAndPros

@Tmeadows97
I don't really know swift, but using C-style syntax: (The ! means not)
You could then say: