-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathOutputView.java
More file actions
29 lines (24 loc) Β· 965 Bytes
/
OutputView.java
File metadata and controls
29 lines (24 loc) Β· 965 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
28
29
package output;
import domain.Rank;
import domain.lotto.LottoCollection;
import domain.LottoStatistics;
/**
* @author delf
*/
public class OutputView {
public static void printLotto(LottoCollection lottoCollection) {
System.out.println(lottoCollection.size() + "κ°λ₯Ό ꡬ맀νμ΅λλ€.");
lottoCollection.forEach(System.out::println);
}
public static void showWinningStatistics(LottoStatistics lottoStatistics) {
final Rank[] PRINT_ORDER_RANK = {Rank.FIFTH, Rank.FOURTH, Rank.THIRD, Rank.SECOND, Rank.FIRST};
System.out.println("λΉμ²¨ ν΅κ³" + "\n" + "-------------");
/*lottoStatistics.forEach(rank -> System.out.println(
String.format("- %s %sκ°", rank, lottoStatistics.getCount(rank)))
);*/
for(Rank rank : PRINT_ORDER_RANK) {
System.out.println(String.format("- %s %sκ°", rank, lottoStatistics.getCount(rank)));
}
System.out.println(String.format("\nμ΄ μμ΅λ₯ μ %.2f%%μ
λλ€.", lottoStatistics.getRor()));
}
}