-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurl.java
More file actions
21 lines (18 loc) · 688 Bytes
/
url.java
File metadata and controls
21 lines (18 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.Scanner;
public class WebsiteTypeChecker {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter a website URL: ");
String url = sc.nextLine().toLowerCase();
if (url.endsWith(".com")) {
System.out.println("This is a Commercial Website.");
} else if (url.endsWith(".org")) {
System.out.println("This is an Organization Website.");
} else if (url.endsWith(".in")) {
System.out.println("This is an Indian Website.");
} else {
System.out.println("Website type not identified.");
}
sc.close();
}
}