-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCH_04_PRACTICE_SET.java
More file actions
74 lines (59 loc) · 1.78 KB
/
Copy pathCH_04_PRACTICE_SET.java
File metadata and controls
74 lines (59 loc) · 1.78 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
import java.util.Scanner;
public class CH_04_PRACTICE_SET {
public static void main(String[] args) {
/* byte m1, m2, m3;
System.out.println("Enter Your Marks");
System.out.println("Enter Your Englsih Marks");
m1 = sc.nextByte();
System.out.println("Enter Your Physics Marks");
m2 = sc.nextByte();
System.out.println("Enter Your Chemistry Marks");
m3 = sc.nextByte();
float avg=(m1+m2+m3)/3.0f ;
if (avg>=40&&m1>=33&&m2>=33&&m3>=33)
{
System.out.println("Cnogratulation You are passed");
}
else{
System.out.println("You are fail");
}
*/
/* System.out.println("Enter the day");
S
int day= sc.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");
case 6 -> System.out.println("Staurday");
case 7 -> System.out.println("Sunday");
default -> System.out.println("no day");
}
System.out.println("Thanks");
*/
/*
int year= sc.nextInt();
if (year%4==0) {
System.out.println("leap year");
}
else
{
System.out.println("Not leap year");
}
*/
System.out.println("Enter the name of websites");
Scanner sc = new Scanner(System.in);
String sites = sc.next();
if (sites.endsWith(".com")) {
System.out.println("Comercial Websites");
}
else if (sites.endsWith(".org")) {
System.out.println("Organisation websites");
}
else if (sites.endsWith(".in")) {
System.out.println("Indian Websites");
}
}
}