输入必须区分大小写的程序

Program with input that has to be Case sensitive

I have an assignment I am doing for my class. I have to write to ask for a year, and then the month by the input of the first three letters of the month. It will output the follows statement "February 2000 has 29 days" from what I am asked for the project. it is supposed to be case sensitive. not sure how to do that. can anyone point me in the right direction? also does this look good or am I being sloppy.

package test.project;

import java.util.Scanner;

/**
 *
 * @author XXXXXXX
 */
public class TESTPROJECT {

  /**
     * @param args the command line arguments
     */
     public static void main(String[] args) {
        // TODO code application logic here
        Scanner input = new Scanner(System.in);        
        System.out.print("Enter a year: ");
        int year = input.nextInt();
        System.out.print("Enter month (first three letters with the first letter in upper case): ");
        String month = input.next();

  //months
    if (month.equals("Jan")){
     System.out.print("Jan " + year);
     System.out.print(" has 31 days.");
     }
    if (month.equals("Feb")){
     System.out.print("Feb " + year);
     //LEAP YEAR FORMULA 
        if (year%4==0&&(year%100!=0||year%400==0))
    {System.out.print(" has 29 days.");
        if (year%4!=0&&(year%100==0||year%400!=0))
    {System.out.print(" has 28 days.");}}
    }
    if (month.equals("Mar")){
     System.out.print("Mar " + year);
     System.out.print(" has 31 days.");
    }
    if (month.equals("Apr")){
     System.out.print("Apr " + year);
     System.out.print(" has 30 days.");
    }
    if (month.equals("May")){
     System.out.print("May " + year);
     System.out.print(" has 31 days.");
    }
    if (month.equals("Jun")){
     System.out.print("Jun " + year);
     System.out.print(" has 30 days.");
    }
    if (month.equals("Jul")){
     System.out.print("Jul " + year);
     System.out.print(" has 31 days.");
    }
    if (month.equals("Aug")){
     System.out.print("August " + year);
     System.out.print(" has 31 days.");
    }
    if (month.equals("Sep")){
     System.out.print("Sep " + year);
     System.out.print(" has 30 days.");
    }
    if (month.equals("Oct")){
     System.out.print("Oct " + year);
     System.out.print(" has 31 days.");
    }
    if (month.equals("Nov")){
     System.out.print("Nov " + year);
     System.out.print(" has 30 days.");
    }
    if (month.equals("Dec")){
     System.out.print("Dec " + year);
     System.out.print(" has 31 days.");
    }

}

}

假设您只是表示月份的第一个字母区分大小写,您可以将其包含在每个 for 循环中

    if (month.equals("Feb") || month.equals("feb")){
       System.out.print("Feb " + year);

假设只有第一个字母区分大小写,这将起作用。 || 意味着如果输入意味着这个 "Feb" 或这个 "feb"。您可以不断地对每个不同的示例使用它,直到它们没有其他可能的 feb 选项,即 FEB、FeB、fEb 等...