Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve the following problem with tester class in java programming language Weather Reporting Imagine that a TV weather reporter forecasts the weather according to the
Solve the following problem with tester class in java programming language
Weather Reporting Imagine that a TV weather reporter forecasts the weather according to the following routine. He/ She reads some data like weather patterns and environment canada reports and then determines a high temperature, low temperature, probability of precipitation (chance of rain or snow) and the anticipated conditions, such as sun, cloud, snow or rain. When the news channel calls up the weather person they generate a graphic to display on the screen and then read off their forecast As new information becomes available such as a change in the wind direction they will update their forecast so that they can generate a new graphic and a be ready in cast the news channel calls on them to once again deliver the most up to date weather For this assignment consider that a weather forecast for any given day consists of a high temperature, a low temperature, a probability of precipitation (Pop) and a predicted weather condition. An example forecast High: -10 Low: -13 Pop: 80% Weather Condition: Snow For this assignment you'll create a program that a TV weather reporter could use to forecast and keep track of the weather. You'll need to create a class that can model' a weather forecast (e.g. WeatherForecast.java) for a single day (that is a class with instance fields for high and low temperature, probability of precipitation and conditions, and the ability to retrieve and modify those fields (getters and setters) On occasion a weather person may have to give a forecast using Fahrenheit or Celsius, by default in Canada we operate in Celsius (so your WeatherForecast class should also do that) but should allow the weather person to toggle all temperatures between Celsius and Fahrenheit To test your WeatherForecast class create another class called SimpleWeatherForecast with a public static void main, it should prompt the user to enter the high temperature, low temperature POP and conditions. Then it should create a WeatherForecast object using those values and print the WeatherForecast back out to screen, convert the temperatures to Fahrenheit and once again print out the forecast Ensure this problem is in a separate folder from Problem 1 (even though you might copy over part of Problem 1's solution) You can use your same WeatherForecastClass from the first problem. However this time you should add a MultidayForecast class that allows a weather forecaster to generate any number of days worth of WeatherForecasts. It will allow a user to edit any of these forecasts- so you'll have to store the WeatherForecast objects in the MultidayForecast class (perhaps in an ArrayListStep 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