Commit e214f4f
committed
feat: Categorize website type based on domain extension using switch-case
🧠 Logic:
- Accepts a website URL as user input and extracts the domain extension using `substring` after the last dot.
- Uses a `switch-case` structure to identify and print the website type:
- `.com` → Commercial Website
- `.org` → Organization
- `.gov` → Government
- `.net` → Network
- Converts extension to lowercase for case-insensitive matching.
- Demonstrates practical string handling and conditional branching based on web domain classification.
Signed-off-by: Somesh diwan <[email protected]>1 parent 6c88336 commit e214f4f
1 file changed
+4
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 5 | + | |
| 6 | + | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | | - | |
18 | | - | |
| 13 | + | |
19 | 14 | | |
20 | 15 | | |
21 | 16 | | |
| |||
33 | 28 | | |
34 | 29 | | |
35 | 30 | | |
36 | | - | |
| 31 | + | |
0 commit comments