-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoxCars.java
More file actions
33 lines (27 loc) · 773 Bytes
/
BoxCars.java
File metadata and controls
33 lines (27 loc) · 773 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
30
31
32
33
public class BoxCars
{
public static void main (String[] args) {
int die_one = 0;
int die_two = 0;
int boxcar = 0;
DieClass Box = new DieClass();
for (int z = 0; z <=1000; z++)
{
die_one = Box.getRoll(6);
die_two = Box.getRoll(6);
System.out.println ("Roll "+z+": you rolled a "+die_one+" and a "+die_two);
if (die_one == 6 && die_two == 6)
{
boxcar++;
}
}
System.out.println ();
System.out.println ("Results");
System.out.println ("======================================");
System.out.println ();
System.out.println ("you rolled box cars "+boxcar+" time(s)");
System.out.println ();
System.out.println ("======================================");
System.out.println ();
}
}