-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
24 lines (22 loc) · 743 Bytes
/
Copy pathMain.java
File metadata and controls
24 lines (22 loc) · 743 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
import classes.*;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner myObj = new Scanner(System.in);
double gamesCount = 0;
double wonCount = 0;
while (true) {
System.out.println("Would You Like to Play Again? Y/N");
String ans = myObj.nextLine();
if (ans.toLowerCase().equals("y")) {
gamesCount += 1.0;
Game game = new Game();
wonCount += game.wOrL;
System.out.println("Win Percentage: " + (Double)(wonCount/gamesCount));
} else if (ans.toLowerCase().equals("n")) {
break;
}
}
}
}