Friday, 16 October 2009
  Some comments about Worksheet 2 by M.Kerber

Exercise 1: The new rounding method has to be able to deal with
arbitrary floating point numbers such as 2.6, 2.5, 2.4, -3.5, -3.0 etc.

Exercise 2: Some have asked me about the understanding of the question.

Let me explain the exercise in different words:

The thermostat should change the state of the central heating and the
air conditioning when the temperature is above/below certain thresholds
and do nothing else.

For instance if the temperature is at 20 degrees, the central heating
would neither be turned on nor turned off. (This is done in order to
avoid frequent switching of the state of the central heating, which
isn't good for its life expectancy.) This is implemented very easily
by not covering the case 18 < temperature < 21.

Likewise for the air conditioning in the range 24 <= temperature <= 25.

One addition to the description may also make the problem clearer:
* Initialize the variables heater_on and air_cond_on (e.g. to false).
(The program will work properly only if the variables are
initialized, it's reasonable to assume that at some point in time the
devices were off.)

There is an error in the specification: The condition "is 21 degrees"
should read "is 21 degrees or above".
If something like that happens to you in real life, point it out to
your customer and ask them whether that is really what they want.


Exercise 3: The web link is broken. It worked before, but doesn't any more. All information necessary for the exercise is on the worksheet.
Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

September 2009 / October 2009 / November 2009 / January 2010 / February 2010 / March 2010 /


Subscribe to
Posts [ Atom ]