-
Notifications
You must be signed in to change notification settings - Fork 409
Expand file tree
/
Copy pathInputView.java
More file actions
27 lines (24 loc) · 934 Bytes
/
InputView.java
File metadata and controls
27 lines (24 loc) · 934 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
27
package menu.view;
import java.io.Console;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class InputView {
public static String getCoachNames() {
System.out.println("점심 메뉴 추천을 시작합니다.\n" +
"코치의 이름을 입력해 주세요. (, 로 구분)");
Scanner scanner = new Scanner(System.in);
String coachNames = scanner.nextLine();
return coachNames;
}
public static List<String[]> getCantFood(String[] coachNames) {
List<String[]> cantFoods = new ArrayList<>();
for (String coachName : coachNames) {
System.out.println(coachName + "(이)가 못 먹는 메뉴를 입력해 주세요.");
Scanner scanner = new Scanner(System.in);
String cantFood = scanner.nextLine();
cantFoods.add(cantFood.split(","));
}
return cantFoods;
}
}