Question: Using abstract classes and interfaces in your final program, implement a weather monitoring system that reads weather data from a file and updates multiple device

Using abstract classes and interfaces in your final program, implement a weather monitoring system that reads weather data from a file and updates multiple device types (Smartphone App, Website and SmartWatch) with the new data. Each device displays the data in its unique way:
Smartphone: Displays concise weather updates.
WeatherApp: Shows a detailed report, including temperature, humidity, and wind speed.
WebsiteDisplay: Logs the update in a file named website_log.txt.
Implement a WeatherStation class to:
Create instances of each WeatherDevice.
Read each line from weather_data.txt, parse the data, and pass it to all devices by calling their displayUpdate methods.
Use exception handling to manage issues such as:
FileNotFoundException if weather_data.txt is missing.
IOException for file read errors.
NumberFormatException if data in the file is incorrectly formatted.
weather_data.txt:
98.8,44,6.9
61.3,62,2.9
73.4,47,0.1
79.1,InvalidData,5.2
81.8,63,3.4
98.6,45
60.9,51,6.0,Extra
77.1,74,1.7
85.4,28,6.7
65.8,53,3.1
60.5,58,3.6
61.4,21,4.7
63.0,38,14.2
81.3,27,8.4
71.9,64,0.4
83.7,57,6.4
88.8,48,3.1
90.3,51,2.8
85.8,53,7.2
61.7,71,11.2
95.2,76,13.1
92.6,56,3.6
63.8,75,4.1
76.9,33,13.1
88.4,31,14.8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!