Skip to content

Instantly share code, notes, and snippets.

@gonaumov
Created September 13, 2020 21:34
Show Gist options
  • Save gonaumov/00153ff1a29963c3be6b712a613d2d21 to your computer and use it in GitHub Desktop.
Save gonaumov/00153ff1a29963c3be6b712a613d2d21 to your computer and use it in GitHub Desktop.
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