Repository navigation
Expand file tree
/
Copy pathTaskTwentyeight.java
More file actions
97 lines (79 loc) · 2.85 KB
/
Copy pathTaskTwentyeight.java
File metadata and controls
97 lines (79 loc) · 2.85 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import java.util.Scanner;
<<<<<<< HEAD
=======
>>>>>>> 23f4b40 (Initial commit)
public class TaskTwentyeight{
public static void main(String[] agrs){
Scanner userInput = new Scanner(System.in);
<<<<<<< HEAD
System.out.print("Enter a month from 1 to 12: ");
int monthInput = userInput.nextInt();
if (monthInput <= 0){
System.out.println("Value outside this range");
}
else if (monthInput == 1){
System.out.println("January");
}
else if (monthInput == 2){
System.out.println("February");
}
else if (monthInput == 3){
System.out.println("March");
}
else if (monthInput == 4){
System.out.println("April");
}
else if (monthInput == 5){
System.out.println("May");
}
else if (monthInput == 6){
System.out.println("June");
}
else if (monthInput == 7){
System.out.println("July");
}
else if (monthInput == 8){
System.out.println("August");
}
else if (monthInput == 9){
System.out.println("September");
}
else if (monthInput == 10){
System.out.println("October");
}
else if (monthInput == 11){
System.out.println("November");
}
else if (monthInput == 12){
System.out.println("December");
}
else if (monthInput > 12){
System.out.println("Value outside this range");
}
}
}
=======
System.out.print("Enter side one of the triangle : ");
int side1Input = userInput.nextInt();
System.out.print("Enter side two of the triangle : ");
int side2Input = userInput.nextInt();
System.out.print("Enter side three of the triangle : ");
int side3Input = userInput.nextInt();
int side12 = side1Input + side2Input;
int side13 = side1Input + side3Input;
int side23 =side2Input + side3Input;
if (side12 > side3Input){
System.out.print("The input does not form a valid triangle");
}
else if (side13 > side2Input){
System.out.print("The input does not form a valid triangle");
}
else if (side23 > side1Input){
System.out.print("The input does not form a valid triangle");
}
else if ( side1Input == side2Input){
System.out.print("it is Equilateral");
}
}
}
>>>>>>> 23f4b40 (Initial commit)