Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve the following problem include tester class in Java programming language. Weather Reporting Imagine that a TV weather reporter forecasts the weather according to the

Solve the following problem include tester class in Java programming language. image text in transcribed
image text in transcribed
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: Snoww For this assignment you'l 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. WeatherForecastjava) 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 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. Sample output is shown below: Sample output is shown below: BlueJ: Terminal Window-Weather Create a Simple WeatherForecast Enter the high temp: 3 Enter the low temp:-1 Enter the POP: 30 Enter the Conditions (Example: sun, cloud, rain or snow): error on purpose Enter the Conditions (Example: sun, cloud, rain or snow): sun Weather Forecast: High: 3.0 Low: -1.0 POP: 30 Conditions: sun Converting to Fahrenheit Weather Forecast: High: 37.4 Low: 30.2 POP: 30 Conditions: sun

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

2. Describe why we form relationships

Answered: 1 week ago

Question

5. Outline the predictable stages of most relationships

Answered: 1 week ago