Question: java: please make sure it compiles. Write a program that reads a temperature as a whole number from the keyboard and outputs a probable season
java: please make sure it compiles.
Write a program that reads a temperature as a whole number from the keyboard and outputs a "probable" season (winter, spring, summer, or fall) depending on the temperature:
if the temperature is greater than 110 or less than -5, than you should output that the temperature entered is outside the valid range
if the temperature is greater than or equal to 90, it is probably summer
if the temperature is greater than or equal to 70 and less than 90, it is probably spring
if the temperature is greater than or equal to 50 and less than 70, it is probably fall
if the temperature is less than 50, it is probably winter
Use the following flow of the program:
if input is out of range
{
give an error
}
else
{
using cascading if statement compute the value of the season
outside of the if block print the result
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
