Created
April 29, 2020 17:47
-
-
Save singhrahuldps/eeb079d9f56ce7709a916633b868524a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int input; | |
| Scanner scanner = new Scanner(System.in); | |
| System.out.println("Enter the code for the day of the week (1-7)"); | |
| input = scanner.nextInt(); | |
| switch(input) { | |
| case 1: System.out.println("Monday"); | |
| break; | |
| case 2: System.out.println("Tuesday"); | |
| break; | |
| case 3: System.out.println("Wednesday"); | |
| break; | |
| case 4: System.out.println("Thursday"); | |
| break; | |
| case 5: System.out.println("Friday"); | |
| break; | |
| case 6: System.out.println("Saturday"); | |
| break; | |
| case 7: System.out.println("Sunday"); | |
| break; | |
| default: System.out.println("Invalid Input"); | |
| } | |
| scanner.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment