Advertisements

Write a program SpringSeason.java that takes two int values

import java.util.Scanner;

public class SpringSeason{

public static void main(String args[])
{
System.out.println(“Enter the month “); //This prompts the user to enter a month
Scanner scan = new Scanner(System.in);
int month = scan.nextInt(); //Stores the valuse as an int

System.out.println(“Enter the day “); //This prompts the user to enter day
int day = scan.nextInt(); //Stores the valuse as an int

boolean wootwoot = (month == 3 && day >= 20 && day <= 31)
|| (month == 4 && day >= 1 && day <= 30)
|| (month == 5 && day >= 1 && day <= 31)
|| (month == 6 && day >= 1 && day <= 20);

System.out.println(wootwoot);

}
}

Advertisements

About Rant4u

A Revolution in Social Networking

Posted on February 18, 2014, in #social media and tagged , , . Bookmark the permalink. Leave a comment.

Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: