-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_19.java
More file actions
40 lines (40 loc) · 1.34 KB
/
Main_19.java
File metadata and controls
40 lines (40 loc) · 1.34 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
import java.util.Scanner;
public class Main_19 {
public static void main(String[] args) {
Scanner in= new Scanner(System.in);
System.out.println("marks of subject 1:");
int m1=in.nextInt();
System.out.println("marks of subject 2:");
int m2=in.nextInt();
System.out.println("marks of subject 3:");
int m3=in.nextInt();
float tot=(m1+m2+m3)/3.0f;
if (m1>33 && m2>33 && m3>33 && tot>40){
System.out.println("pass");
}
else{
System.out.println("fail");
}
System.out.println("Enter number of day:");
int day=in.nextInt();
switch (day){
case 1-> System.out.println("monday");
case 2-> System.out.println("tuesday");
case 3-> System.out.println("wednesday");
case 4-> System.out.println("thursday");
case 5-> System.out.println("friday");
default-> System.out.println("weekend");
}
System.out.println("Enter website:");
String site=in.next();
if (site.endsWith(".org")) {
System.out.println("organizational");
}
else if (site.endsWith(".com")) {
System.out.println("commercial");
}
else if (site.endsWith(".in")) {
System.out.println("indian");
}
}
}