-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathFindTheDay.java
More file actions
36 lines (31 loc) · 1.37 KB
/
FindTheDay.java
File metadata and controls
36 lines (31 loc) · 1.37 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
public class FindTheDay {
public static void main(String[] args) {
String whatIsToday = "Monday";
if(whatIsToday.equals("Monday")) {
System.out.println("It is weekday");
} else if (whatIsToday.equals("Tuesday")) {
System.out.println("It is weekday");
} else if (whatIsToday.equals("Wednesday")) {
System.out.println("It is weekday");
} else if (whatIsToday.equals("Thursday")) {
System.out.println("It is weekday");
} else if (whatIsToday.equals("Friday")) {
System.out.println("It is weekday");
} else if (whatIsToday.equals("Saturday")) {
System.out.println("It is weekend");
} else if (whatIsToday.equals("Sunday")) {
System.out.println("It is weekend");
} else {
System.out.println("Invalid input. Please check the same");
}
if(whatIsToday.equals("Monday") || whatIsToday.equals("Tuesday")
|| whatIsToday.equals("Wednesday") || whatIsToday.equals("Thursday")
|| whatIsToday.equals("Friday")) {
System.out.println("It is weekday");
} else if (whatIsToday.equals("Saturday") || whatIsToday.equals("Sunday")) {
System.out.println("It is weekend");
} else {
System.out.println("Invalid input. Please check the same");
}
}
}