Question: In a class named Seasons, write a program that takes an input number representing a month: an integer from 1 to 12 (January to December).

In a class named Seasons, write a program that takes an input number representing a month: an integer from 1 to 12 (January to December). Then program should output what season that month is in ( Winter, Spring, Summer, Fall).

In the the program should be a method called getSeason that takes one parameter, an int representing a month value, and should return a String value representing the season that month is in.

If the month value is for January through March (1 through 3), then getSeason should return "winter".

If the month value is for April through June (4 through 6), then getSeason should return "spring".

If the month value is for July through September (7 through 9), then getSeason should return "summer".

If the month value is for October through December (10 through 12), then getSeason should return "fall".

The getSeason method should be called from your program's main method and its return value should be printed out in the main method.

Example should look like:

I'll tell you the season for a month value. Enter a month value (1-12): 2 The season is: winter 

This is in Java.

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!