Question: You should adjust the following code to output a probable season (winter, spring, summer, or fall) depending on a temperature inputted from the user. This

 You should adjust the following code to output a "probable" season

You should adjust the following code to output a "probable" season (winter, spring, summer, or fall) depending on a temperature inputted from the user. This program prompts the user for a temperature, parses that response to an integer, and displays a message box that reads "Based on the temperature of (whatever temperature they entered) it is most likely ". This program will not compile at this time since you do not have a determineSeason method yet. Your job is to create a new functional method called determineSeason that returns the season based on the temperature You will need to use conditionals to make this program determine the probable season that matches what the user entered for their temperature This is a simple Java program that guesses the season * depending on the temperature entered. */ 4(-] import j avax. sing . * ; 6 public class Seasons t public static void main (String[ args) int inputTemp: String response = JOptionPane. shovInputDialog (null, 10 "Enter the temperature", " Probable season", 1) 12 13 14 inputTempInteger parseInt (response) String message = "Based on the temperature of " + inputTemp +" it is most likely" + determineSeason (inputTemp) 16 17 18 JOptionPane. shovMessageDialog (null, message) Criteria o Invalid: Temperature is greater than 130 or less than -20 o Summer: Temperature is greater than or equal to 90 o Spring: Temperature is greater than or equal to 70 and less than 90 o Fall: Temperature is greater than or equal to 50 and less than 70 o Winter: Temperature is less than 50 Rubric: Set up a new method called determineSeason. This method should include all of your conditionals (if/else statements). It should take in the inputTemp variable as a parameter and it should return a String. The String should be the season. This method is already called from the println method in the main method. The determineSeason method must return a value. (5 points) Logic for determine summer, spring, fall, winter, and invalid (10 points)

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!