private static void Main() { WeatherReporter weatherReporter = new WeatherReporter(); CurrentConditions currentConditions = new CurrentConditions(weatherReporter); WeatherStatistics weatherStatistics = new WeatherStatistics(weatherReporter); WeatherForecast weatherForecast = new WeatherForecast(weatherReporter); HeatIndex heatIndex = new HeatIndex(weatherReporter); weatherReporter.SetMeasurements(80, 65, 30.4f); weatherReporter.SetMeasurements(82, 70, 29.2f); weatherReporter.SetMeasurements(78, 90, 29.2f); Console.ReadKey(); }
public static void Run() { WeatherData weatherData = new WeatherData(); CurrentConditionsDisplay currentDisplay = new CurrentConditionsDisplay(weatherData); StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData); ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData); HeatIndex heatIndex = new HeatIndex(weatherData); // Simulate new weather measurements weatherData.SetMeasurements(80, 65, 30.4f); Console.WriteLine(); weatherData.SetMeasurements(82, 70, 29.2f); Console.WriteLine(); weatherData.SetMeasurements(78, 90, 29.2f); Console.WriteLine(); }