Question: Weather Forecast Project (JAVA) Create a New Java Project called YourLastNameWeatherForecast . Write a Weather class encapsulating the concept of the weather forecast. It has

Weather Forecast Project (JAVA)

Create a New Java Project called YourLastNameWeatherForecast.

Write a Weather class encapsulating the concept of the weather forecast. It has the following attributes: the temperature and the sky conditions. The only valid sky conditions are sunny, snowy, foggy, cloudy, or rainy. Include a constructor, the accessors and mutators, and methods toString and equals. Temperature, in Fahrenheit, should be between -50 and +150; the default temperature value is 70. The default sky condition is sunny.

Include a method that converts Fahrenheit to Celsius. The formula to perform this conversion is below.

Celsius temperature = (Fahrenheit temperature - 32) * 5/9

Also include a method that checks whether the weather attributes are consistent. (NOTE: There are two cases where they are not consistent: when the temperature is above 32 and it is snowy; and when the temperature is below 32 and it is rainy.)

NOTE: The Weather class is a new class within your project. It should be defined as a separate file within your Java Project. This new class does not affect the name of your Java Project above.

Write a program that prompts the user to enter the temperature and sky condition. Display the temperature converted to Celsius and whether or not the weather attributes entered are consistent. The temperature should be formatted to exactly two decimal places.

Continuously prompt the user for input until the user chooses to end the program. Be sure to use clear prompts for the user.

Input Validation: Do not accept unreasonable/junk values from the user, which must be rejected and asked for another one.

PROGRAMMING GUIDELINES: A programming assignment will be assigned a grade of 0 if it fails to compile. Each program must not contain any spelling errors in the program output or points will be deducted. Each program must contain a comment section (or points will be deducted) that indicates the following: 1. Student Name 2. Program Name 3. Short Program Description 4. Due Date Programs should use appropriate spacing and indentation, in order to increase readability. Programs should only be completed in Eclipse. Use comments for clarification throughout your programs. Use meaningful variable names. Subdivide your program into mini-sections. For more difficult programs, this will make it easier to detect both syntax and logical errors. Naming Convention for mutator methods: set + fieldname (i.e. setName) Naming Convention for accessor methods: get + fieldname (i.e. getName)

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 Databases Questions!