-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathps4_q3.java
More file actions
29 lines (27 loc) · 798 Bytes
/
Copy pathps4_q3.java
File metadata and controls
29 lines (27 loc) · 798 Bytes
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
package com.barneel;
import java.util.Scanner;
//find type of site from url.
public class ps4_q3
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String url = sc.nextLine();
boolean company = url.endsWith(".com");
boolean organisation = url.endsWith(".org");
boolean indianSite = url.endsWith(".in");
if (company == true) {
System.out.println("This is a company website");
} else if (organisation == true) {
System.out.println("this is an organisational website");
}
else if(indianSite==true)
{
System.out.println("this is an indian site");
}
else
{
System.out.println("undetectable!");
}
}
}