Repository navigation
Expand file tree
/
Copy pathTaskThirty.java
More file actions
49 lines (36 loc) · 1.41 KB
/
Copy pathTaskThirty.java
File metadata and controls
49 lines (36 loc) · 1.41 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
import java.util.Scanner;
public class TaskThirty{
public static void main(String[] agrs){
Scanner userInput = new Scanner(System.in);
<<<<<<< HEAD
System.out.print("Enter the current hour: ");
int hourInput = userInput.nextInt();
if (hourInput == 5 || hourInput <= 11){
System.out.println("Good Morning");
}
else if (hourInput == 12 || hourInput <= 17){
System.out.println("Good Afternoon");
}
else if (hourInput == 18 || hourInput <= 21){
System.out.println("Good Evening");
}
else if (hourInput == 22 || hourInput <= 24){
System.out.println("Good Night");
}
else if(hourInput == 1 || hourInput <= 4){
System.out.println("Good Night");
}
else
System.out.println("Out of Range");
}
}
=======
System.out.print("Enter a number of seconds: ");
int secondsInput = userInput.nextInt();
int totalMinute = secondsInput / 60;
int secondsRemining = secondsInput % 60;
int tatalhours = totalMinute / 60;
System.out.print(secondsInput +" seconds = "+ tatalhours + " hours," + totalMinute +" minutes, "+ secondsRemining + "seconds\n");
}
}
>>>>>>> 23f4b40 (Initial commit)