Enter an integer from the keyboard, representing the month, and programmatically determine which quarter of the year the specified month belongs to. If it's a
month, January, February, belong to winter, if it is March, April, May, it belongs to the spring, if it is June, July,
August, it belongs to the summer, if it is September, October, November, fall. When you enter a different number, you are prompted for incorrect input .
1 PackageExam01; 2 3 ImportJava.util.Scanner; 4 5 Public classTOPIC05 {6 7 Public Static voidMain (string[] args) {8 //TODO auto-generated Method Stub9 intMonth = 0; TenScanner input =NewScanner (system.in); OneSystem.out.println ("Please enter month:"); A intMouth=Input.nextint (); - Switch(month) { - Case12: the Case1: - Case2: -System.out.println (mouth+ "is Winter"); - Break; + Case3: - Case4: + Case5: ASystem.out.println (mouth+ "is Spring"); at Break; - Case6: - Case7: - Case8: -System.out.println (mouth+ "is Summer"); - Break; in Case9: - Case10: to Case11: +System.out.println (mouth+ "is Autumn"); - Break; the default: *SYSTEM.OUT.PRINTLN ("Incorrect input"); $ } Panax Notoginseng } - the}
Java Programming Basics-------> Enter an integer from the keyboard, representing the month, and programmatically determine which quarter of the year the specified month belongs to. If it is December, January, February, it belongs to winter.