Question
Java. Write a program called WeatherReporter that prompts the user for an input file name. reads the given file, which is in the format of
Java. Write a program called WeatherReporter that prompts the user for an input file name. reads the given file, which is in the format of CharlotteWeather2010.txt, line by line and uses the processLine() method as defined below:
public static void processLine (String line){ }
to output to the console the data for each day formatted as shown below:
01/01/2010 Low: 34.0 High: 48.0 Rain: no Snow: no 01/02/2010 Low: 24.1 High: 48.0 Rain: no Snow: no ... 07/05/2010 Low: 61.0 High: 97.0 Rain: no Snow: no 07/06/2010 Low: 64.0 High: 100.9 Rain: no Snow: no 07/07/2010 Low: 66.0 High: 102.0 Rain: no Snow: no ... 12/26/2010 Low: 28.4 High: 36.0 Rain: yes Snow: yes 12/27/2010 Low: 21.2 High: 37.4 Rain: no Snow: no ...
CharlotteWeather2010.txt
Should be in the format of:
YYYYMMDD Average(F) High(F) Low(F) Fog/Rain/Snow/Hail/Thunder/Tornado 20100101 44.2 48 34 100000 20100102 29.9 48 24.1 000000 20100103 24.2 32 18 000000 20100104 26.2 36 17.1 000000 20100105 26.9 36 17.1 000000 20100106 29.1 41 18 000000 20100107 32.4 48 19 000000 20100108 35.1 48 20.1 010000 20100109 25.9 35.6 19.4 000000 20100110 28 37.4 19.4 000000 20100111 27.6 45 15.1 000000 20100112 34.9 45 16 000000 20100113 31.4 44.6 19.4 000000 20100114 37.5 57.2 24.8 000000 20100115 42.9 63 25.2 000000 20100116 44 63 28.2 000000 20100117 53.6 68 30.2 010000 20100118 50.9 68 39.9 100000 20100119 47.8 66.2 35.6 000000 20100120 51.2 66 35.1 000000 20100121 40.2 64.9 37 010000 20100122 37.9 41 37 010000
...etc.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started