Created
September 13, 2020 21:34
-
-
Save gonaumov/00153ff1a29963c3be6b712a613d2d21 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
import java.util.Scanner; | |
class Main { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int shape = scanner.nextInt(); | |
String message; | |
switch (shape) { | |
case 1: | |
message = "You have chosen a square"; | |
break; | |
case 2: | |
message = "You have chosen a circle"; | |
break; | |
case 3: | |
message = "You have chosen a triangle"; | |
break; | |
case 4: | |
message = "You have chosen a rhombus"; | |
break; | |
default: | |
message = "There is no such shape!"; | |
break; | |
} | |
System.out.println(message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment