Fortune Telling Collection - Zodiac Guide - Java basic questions, about the input of the moon and day to judge the constellation, ask for advice.
Java basic questions, about the input of the moon and day to judge the constellation, ask for advice.
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");
}
}
}
- Previous article:1990922 What constellation?
- Next article:What are the exclusive star dresses and evening dresses of the twelve constellations?
- Related articles
- What is the constellation of Winter Moon 13 in 1982?
- The lucky pet of the zodiac is
- ID card 1996 1.22 How long does it take to get a marriage certificate?
- Lunar calendar1what constellation was born on June 4, 999?
- Three constellations that are easy to be mean when in love?
- A constellation girl with a soft and kind heart
- On the question of love, who are the three constellation women who love to miss other people's boyfriends?
- What constellations are there _ What constellations are there?
- I want to watch Yang Yang constellation _ I want to watch Yang Yang constellation video.
- Captain GD information of bigbang