public void Update(IMySubject weatherData) { var temperature = weatherData.GetTemperature(); _numberofreadings++; _sumtemperature += temperature; if (_numberofreadings == 1) { // first reading so default both to the same temperature _maxtemperature = temperature; _mintemperature = temperature; } else { // do checks if (temperature > _maxtemperature) { _maxtemperature = temperature; } if (temperature < _mintemperature) { _mintemperature = temperature; } } Display(); }
public void Update(IMySubject weatherData) { _temperature = weatherData.GetTemperature();; _humidity = weatherData.GetHumidity(); Display(); }
public void Update(IMySubject weatherData) { _temperature = weatherData.GetTemperature(); ; _humidity = weatherData.GetHumidity(); Display(); }
public void Update(IMySubject weatherData) { _heatindex = computeHeatIndex(weatherData.GetTemperature(), weatherData.GetHumidity()); }