
public class WeatherStation {
public static void main(String[] args) {
WeatherData weatherData = new WeatherData();
CurrentConditionsDisplay currentDisplay =
new CurrentConditionsDisplay(weatherData);
StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData);
ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData);
weatherData.setMeasurements(80, 65, 30.4f);
weatherData.setMeasurements(82, 70, 29.2f);
weatherData.setMeasurements(78, 90, 29.2f);
}
}
気象観測所の機能を強化する
ファイル 編集 ウィンドウ
ヘルプ 荒れた天候
%java WeatherStation
現在の気象状況:温度
80.0
度(華氏) 湿度
65.0%
平均
/
最高
/
最低気温:
80.0/80.0/80.0
予報:天候は良くなります!
現在の気象状況:温度
82.0
度(華氏) 湿度
70.0%
平均
/
最高
/
最低気温:
81.0/82.0/80.0 ...