sudoaptinstallname

Untitled

Jan 17th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Website_Checker {
  6. public static void main(String[] args){
  7. Scanner input = new Scanner(System.in);
  8.  
  9. System.out.print("Input a website address:");
  10. String sentence = input.nextLine();
  11.  
  12. switch((sentence.substring(sentence.length() - 4)))
  13. {
  14.  
  15. case ".com":
  16. System.out.print("Commercial.");
  17. break;
  18. case ".gov":
  19. System.out.print("Government.");
  20. break;
  21. case ".edu":
  22. System.out.print("Education.");
  23. break;
  24. case ".org":
  25. System.out.print("Organization.");
  26. break;
  27. default:
  28. System.out.print("Unknown / Invalid.");
  29. break;
  30. }
  31.  
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment