Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve the following problems with Tester Class in Java programming language. Weather Reporting Imagine that a TV weather reporter forecasts the weather according to the
Solve the following problems 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 An example forecast 0 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 n 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 Simple WeatherForecast 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 Sample output is shown below You can use your same should add a MultidayForecast class that alows 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 from the first problem. However this time you To avoid having to enter too much information manually, your MultidayForecast class should have a method to automatically generate the desired number of forecast days (using random numbers). Ensure that the randomly generated data makes some sense .e, temperatures between-30 and +30 with low temperatures less than high temperatures, random POP between 0 and 100 and a weather condition that is one of snow, rain, cloud or sun). Once again create one more class that contains a public static void main (and perhaps other static methods) that has a simple text menu alowing a user to create a MultidayForecast with between 1 and 5 days and allows them to edit any of those forecast days and/or print the whole forecast out to screen Sample output: Cenerating3 daysof weather forecasts 2 it the Ferecant Meather Ferecast bayI Condit ions Heather Forecast ay Condse ionss s Weather Farecast tay teit the Ferecast Choices 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 An example forecast 0 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 n 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 Simple WeatherForecast 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 Sample output is shown below You can use your same should add a MultidayForecast class that alows 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 from the first problem. However this time you To avoid having to enter too much information manually, your MultidayForecast class should have a method to automatically generate the desired number of forecast days (using random numbers). Ensure that the randomly generated data makes some sense .e, temperatures between-30 and +30 with low temperatures less than high temperatures, random POP between 0 and 100 and a weather condition that is one of snow, rain, cloud or sun). Once again create one more class that contains a public static void main (and perhaps other static methods) that has a simple text menu alowing a user to create a MultidayForecast with between 1 and 5 days and allows them to edit any of those forecast days and/or print the whole forecast out to screen Sample output: Cenerating3 daysof weather forecasts 2 it the Ferecant Meather Ferecast bayI Condit ions Heather Forecast ay Condse ionss s Weather Farecast tay teit the Ferecast Choices 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