-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUse.java
More file actions
26 lines (24 loc) · 715 Bytes
/
Use.java
File metadata and controls
26 lines (24 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.Scanner;
class Use {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
final int moveDirection = scanner.nextInt();
String direction = new String("");
switch(moveDirection) {
case 1:
direction = "move up";
break;
case 2:
direction = "move down";
break;
case 3:
direction = "move left";
break;
case 4:
direction = "move right";
break;
default: direction = "do not move";
}
System.out.println(direction);
}
}