Advertisement
veronikaaa86

01. Day of Week

Oct 16th, 2021
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. package conditionalStatementsAdvanced;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P01DayOfWeek {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. int num = Integer.parseInt(scanner.nextLine());
  10.  
  11. switch (num) {
  12. case 1: System.out.println("Monday");
  13. break;
  14. case 2:
  15. System.out.println("Tuesday");
  16. break;
  17. case 3:
  18. System.out.println("Wednesday");
  19. break;
  20. case 4:
  21. System.out.println("Thursday");
  22. break;
  23. case 5:
  24. System.out.println("Friday");
  25. break;
  26. case 6:
  27. System.out.println("Saturday");
  28. break;
  29. case 7:
  30. System.out.println("Sunday");
  31. break;
  32. default:
  33. System.out.println("Error");
  34. }
  35. }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement