-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitchCase1.java
28 lines (26 loc) · 905 Bytes
/
switchCase1.java
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
import java.util.*;
public class switchCase1
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
String site=sc.nextLine();
String ext=site.substring(site.lastIndexOf(".")+1);
sc.close();
switch(ext)
{
case "gov" : System.out.println("GOVERNMENT");
break;
case "ent" : System.out.println("ENTERPRISE");
break;
case "org" : System.out.println("ORGANISATION");
break;
case "net" : System.out.println("NETWORK");
break;
case "com" : System.out.println("COMMERCIAL");
break;
default : System.out.println("INVALID SITE");
break;
}
}
}