-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathInputView.java
More file actions
34 lines (28 loc) · 1.02 KB
/
InputView.java
File metadata and controls
34 lines (28 loc) · 1.02 KB
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
27
28
29
30
31
32
33
34
package view;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
public class InputView {
Scanner scanner = new Scanner(System.in);
public List<String> inputParticipants() {
System.out.println("참여할 사람 이름을 입력하세요. (이름은 쉼표(,)로 구분하세요)");
String input = scanner.nextLine();
return Arrays.asList(input.split(","));
}
public List<String> inputResults() {
System.out.println("실행 결과를 입력하세요. (결과는 쉼표(,)로 구분하세요)");
String input = scanner.nextLine();
return Arrays.asList(input.split(","));
}
public int heightSize() {
System.out.println("최대 사다리 높이는 몇 개인가요?");
int height = scanner.nextInt();
scanner.nextLine();
return height;
}
public String inputQueryName() {
System.out.println();
System.out.println("결과를 보고 싶은 사람은?");
return scanner.nextLine();
}
}