Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class scratch_2 {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.println("Please enter a month number:");
- int month = input.nextInt();
- System.out.println("Input a year:");
- int year = input.nextInt();
- input.nextInt();
- if(month == 1 && year == 2010)
- {
- System.out.println("January 2010 has 31 days");
- }
- else if(month == 2 && year == 2010)
- {
- System.out.println("February 2010 has 28 days");
- }
- else if(month == 3 && year == 2010)
- {
- System.out.println("March 2010 has 31 days");
- }
- else if(month == 4 && year == 2010)
- {
- System.out.println("April 2010 has 30 days");
- }
- else if(month == 5 && year == 2010)
- {
- System.out.println("May 2010 has 31 days");
- }
- else if(month == 6 && year == 2010)
- {
- System.out.println("June 2010 has 30 days");
- }
- else if(month == 7 && year == 2010)
- {
- System.out.println("July 2010 has 31 days");
- }
- else if(month == 8 && year == 2010)
- {
- System.out.println("August 2010 has 31 days");
- }
- else if(month == 9 && year == 2010)
- {
- System.out.println("September 2010 has 30 days");
- }
- else if(month == 10 && year == 2010)
- {
- System.out.println("October 2010 has 31 days");
- }
- else if(month == 11 && year == 2010)
- {
- System.out.println("November 2010 has 30 days");
- }
- else if(month == 12 && year == 2010)
- {
- System.out.println("December 2010 has 31 days");
- }
- else if(month == 1 && year == 2011)
- {
- System.out.println("January 2011 has 31 days");
- }
- else if(month == 2 && year == 2011)
- {
- System.out.println("February 2011 has 28 days");
- }
- else if(month == 3 && year == 2011)
- {
- System.out.println("March 2011 has 31 days");
- }
- else if(month == 4 && year == 2011)
- {
- System.out.println("April 2011 has 30 days");
- }
- else if(month == 5 && year == 2011)
- {
- System.out.println("May 2011 has 31 days");
- }
- else if(month == 6 && year == 2011)
- {
- System.out.println("June 2011 has 30 days");
- }
- else if(month == 7 && year == 2011)
- {
- System.out.println("July 2011 has 31 days");
- }
- else if(month == 8 && year == 2011)
- {
- System.out.println("August 2011 has 31 days");
- }
- else if(month == 9 && year == 2011)
- {
- System.out.println("September 2011 has 30 days");
- }
- else if(month == 10 && year == 2011)
- {
- System.out.println("October 2011 has 31 days");
- }
- else if(month == 11 && year == 2011)
- {
- System.out.println("November 2011 has 30 days");
- }
- else if(month == 12 && year == 2011)
- {
- System.out.println("December 2011 has 31 days");
- }
- else if(month == 1 && year == 2012)
- {
- System.out.println("January 2012 has 31 days");
- }
- else if(month == 2 && year == 2012)
- {
- System.out.println("February 2010 has 29 days");
- }
- else if(month == 3 && year == 2012)
- {
- System.out.println("March 2012 has 31 days");
- }
- else if(month == 4 && year == 2012)
- {
- System.out.println("April 2012 has 30 days");
- }
- else if(month == 5 && year == 2012)
- {
- System.out.println("May 2012 has 31 days");
- }
- else if(month == 6 && year == 2012)
- {
- System.out.println("June 2012 has 30 days");
- }
- else if(month == 7 && year == 2012)
- {
- System.out.println("July 2012 has 31 days");
- }
- else if(month == 8 && year == 2012)
- {
- System.out.println("August 2012 has 31 days");
- }
- else if(month == 9 && year == 2012)
- {
- System.out.println("September 2012 has 30 days");
- }
- else if(month == 10 && year == 2012)
- {
- System.out.println("October 2012 has 31 days");
- }
- else if(month == 11 && year == 2012)
- {
- System.out.println("November 2012 has 30 days");
- }
- else if(month == 12 && year == 2012)
- {
- System.out.println("December 2012 has 31 days");
- }
- else if(month == 1 && year == 2013)
- {
- System.out.println("January 2013 has 31 days");
- }
- else if(month == 2 && year == 2013)
- {
- System.out.println("February 2013 has 28 days");
- }
- else if(month == 3 && year == 2013)
- {
- System.out.println("March 2013 has 31 days");
- }
- else if(month == 4 && year == 2013)
- {
- System.out.println("April 2013 has 30 days");
- }
- else if(month == 5 && year == 2013)
- {
- System.out.println("May 2013 has 31 days");
- }
- else if(month == 6 && year == 2013)
- {
- System.out.println("June 2013 has 30 days");
- }
- else if(month == 7 && year == 2013)
- {
- System.out.println("July 2013 has 31 days");
- }
- else if(month == 8 && year == 2013)
- {
- System.out.println("August 2013 has 31 days");
- }
- else if(month == 9 && year == 2013)
- {
- System.out.println("September 2013 has 30 days");
- }
- else if(month == 10 && year == 2013)
- {
- System.out.println("October 2013 has 31 days");
- }
- else if(month == 11 && year == 2013)
- {
- System.out.println("November 2010 has 30 days");
- }
- else if(month == 12 && year == 2013)
- {
- System.out.println("December 2010 has 31 days");
- }
- else if(month == 1 && year == 2014)
- {
- System.out.println("January 2014 has 31 days");
- }
- else if(month == 2 && year == 2014)
- {
- System.out.println("February 2014 has 28 days");
- }
- else if(month == 3 && year == 2014)
- {
- System.out.println("March 2014 has 31 days");
- }
- else if(month == 4 && year == 2014)
- {
- System.out.println("April 2014 has 30 days");
- }
- else if(month == 5 && year == 2014)
- {
- System.out.println("May 2014 has 31 days");
- }
- else if(month == 6 && year == 2014)
- {
- System.out.println("June 2014 has 30 days");
- }
- else if(month == 7 && year == 2014)
- {
- System.out.println("July 2014 has 31 days");
- }
- else if(month == 8 && year == 2014)
- {
- System.out.println("August 2014 has 31 days");
- }
- else if(month == 9 && year == 2014)
- {
- System.out.println("September 2014 has 30 days");
- }
- else if(month == 10 && year == 2014)
- {
- System.out.println("October 2014 has 31 days");
- }
- else if(month == 11 && year == 2014)
- {
- System.out.println("November 2014 has 30 days");
- }
- else if(month == 12 && year == 2014)
- {
- System.out.println("December 2014 has 31 days");
- }
- if(month == 1 && year == 2015)
- {
- System.out.println("January 2015 has 31 days");
- }
- else if(month == 2 && year == 2015)
- {
- System.out.println("February 2015 has 28 days");
- }
- else if(month == 3 && year == 2015)
- {
- System.out.println("March 2015 has 31 days");
- }
- else if(month == 4 && year == 2015)
- {
- System.out.println("April 2015 has 30 days");
- }
- else if(month == 5 && year == 2015)
- {
- System.out.println("May 2015 has 31 days");
- }
- else if(month == 6 && year == 2015)
- {
- System.out.println("June 2015 has 30 days");
- }
- else if(month == 7 && year == 2015)
- {
- System.out.println("July 2015 has 31 days");
- }
- else if(month == 8 && year == 2015)
- {
- System.out.println("August 2015 has 31 days");
- }
- else if(month == 9 && year == 2015)
- {
- System.out.println("September 2015 has 30 days");
- }
- else if(month == 10 && year == 2015)
- {
- System.out.println("October 2015 has 31 days");
- }
- else if(month == 11 && year == 2015)
- {
- System.out.println("November 2015 has 30 days");
- }
- else if(month == 12 && year == 2015)
- {
- System.out.println("December 2015 has 31 days");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement