Java basic questions, about the input of the moon and day to judge the constellation, ask for advice.

Import? Java . text . parse exception;

Import? Java . text . simple date format;

Import? Java.util calendar;

Import? Java . util . date;

Import? Java . util . scanner;

Public? Class? Testing? {

Public? Static electricity Invalid? main(String[]? args)? Throwing? ParseException? {

Scanner? Scanner? =? New? Scanner (system. in);

//? Enter only the month and day. This code does not check whether the month and date are reasonable, such as February 30th.

System.out.print ("Please enter your birth month");

int? Month? =? scanner . nextint();

System.out.print ("Please enter your date of birth");

int? Day? =? scanner . nextint();

System.out.print ("Your constellation is:");

//? By entering a complete date, you can automatically handle unreasonable dates, such as February 30th.

//? SimpleDateFormat? Date format? =? New? simple date format(" yyyy-MM-DD ");

//? System.out.print ("Please enter your date of birth (in the format of 2018-02-03):");

//? Dating? Birthday =? date format . parse(scanner . nextline());

//

//? Calendar? Calendar? =? calendar . getinstance();

//? Calendar.setTime (birthday);

//? int? Month? =? Calendar.get (calendar. Month)? +? 1;

//? int? Day? =? Calendar.get (calendar. Month day);

//? System.out.print ("When is your birthday? :"? +? DateFormat.format (birthday)? +? "\ r \ Your constellation is:");

scanner . close();

Switch? (month)? {

Case? 1:

What if? (day? & lt? 22)

System.out.println ("Capricorn");

other

System.out.println ("Aquarius");

Break;

Case? 2:

What if? (day? & lt? 22)

System.out.println ("Aquarius");

other

System.out.println ("Pisces");

Break;

Case? 3:

What if? (day? & lt? 22)

System.out.println ("Pisces");

other

system . out . println(" Aries ");

Break;

Case? 4:

What if? (day? & lt? 22)

system . out . println(" Aries ");

other

system . out . println(" Taurus ");

Break;

Case? 5:

What if? (day? & lt? 22)

system . out . println(" Taurus ");

other

System.out.println ("Gemini");

Break;

Case? 6:

What if? (day? & lt? 22)

System.out.println ("Gemini");

other

system . out . println(" Cancer ");

Break;

Case? 7:

What if? (day? & lt? 22)

system . out . println(" Cancer ");

other

system . out . println(" Leo ");

Break;

Case? 8:

What if? (day? & lt? 22)

system . out . println(" Leo ");

other

System.out.println ("Virgo");

Break;

Case? 9:

What if? (day? & lt? 22)

System.out.println ("Virgo");

other

system . out . println(" Libra ");

Break;

Case? 10:

What if? (day? & lt? 22)

system . out . println(" Libra ");

other

System.out.println ("Scorpio");

Break;

Case? 1 1:

What if? (day? & lt? 22)

System.out.println ("Scorpio");

other

System.out.println ("Sagittarius");

Break;

Case? 12:

What if? (day? & lt? 22)

System.out.println ("Sagittarius");

other

System.out.println ("Capricorn");

}

}

}