Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a weather class that prints messages for the weather. The program will get Fahrenheit degree from user input and print out the following messages

Create a weather class that prints messages for the weather. The program will get Fahrenheit degree from user input and print out the following messages on the screen:

  • If the temperature in Fahrenheit is over 100, print out the message Give us Ice! We are almost dead!!.
  • If the temperature in Fahrenheit is over 95, print out the message It's too hot!.
  • If the temperature in Fahrenheit is over 86, print out the message It's still hot!.
  • If the temperature in Fahrenheit is over 77, print out the message It's O.K!.
  • If the temperature in Fahrenheit is over 68, print out the message It's good to do exercise!.
  • If the temperature in Fahrenheit is over 50, print out the message It'scool !.
  • If the temperature in Fahrenheit is over 32, print out the message It's chilly!.
  • If the temperature in Fahrenheit is less than 32, print out the message Its cold!.

Your Weather class should include constructor, setWeather, getWeather, and message methods. Your message method should have a return type string and then write a program that demonstrates the Weather by asking the user for the Fahrenheit degree, creating a Weather object, and then reporting the message to the user. Code needs comments and is JAVA

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions