Chapter 3 Thermostat Assignment


#1

So I am really struggling with this. Every time I get one formula to work it doesn’t work on any of the others. Also the temp are supposed to go from 40 to 89, problem 4 ends with 41. The next dial is supposed to be -1 which I would think would give you a value of 40 but they are asking for a value of 89. I looked at some of the older topics having to do with this issue but I can’t seem to find a hint that would send me in the right direction. Any help is appreciated. Thanks.


#2

My biggest clarification would be that each “click” is its on problem. You said that problem 4 should be 41. The next problem, with the click at -1 is a completely different problem (therefore, would go backwards 1 from 40, reverting back to 89.

Think back to chapter 2 (section 6), where they talk about the modulo operator. Hope that helps a little…


#3

Thank you so much! I was starting each new problem as if the beginning value had changed. I spent hours on that. Oh well, I got some good coding practice. You saved my sanity! :grinning:


#4

That was my initial impression too. Perhaps the way they phrased the problem/exercise was ambiguous.