-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonthDaysCalculator.java
More file actions
70 lines (64 loc) · 2.01 KB
/
Copy pathMonthDaysCalculator.java
File metadata and controls
70 lines (64 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import java.util.Scanner;
public class MonthDaysCalculator {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("Enter the mouth you what : ");
String mouth = input.nextLine().trim();
switch(mouth){
case "january":{
System.out.print(" They are 31 days");
}
break;
case "march":{
System.out.print(" They are 31 days");
}
break;
case "may":{
System.out.print(" They are 31 days");
}
break;
case "july":{
System.out.print(" They are 31 days");
}
break;
case "august":{
System.out.print(" They are 31 days");
}
break;
case "october":{
System.out.print(" They are 31 days");
}
break;
case "december":{
System.out.print(" They are 31 days");
}
break;
case "april":{
System.out.print(" They are 30 days");
}
case "june":{
System.out.print(" They are 30 days");
}
case "september":{
System.out.print(" They are 30 days");
}
case "november":{
System.out.print(" They are 30 days");
}
case"february":
System.out.print("this year is Leap year (true/false) : ");
boolean yesOrNo = input.nextBoolean();
if(true){
System.out.print("They are 29 days");
}else{
System.out.print(" They are 28 days");
}
break;
default:{
System.out.print("Invalid mouth");
}
break;
}
input.close();
}
}