Skip to content

Instantly share code, notes, and snippets.

@gitaficionado
Created December 15, 2016 17:57
Show Gist options
  • Save gitaficionado/493be08d2cfd29705a4a13d2a8d5c6fc to your computer and use it in GitHub Desktop.
Save gitaficionado/493be08d2cfd29705a4a13d2a8d5c6fc to your computer and use it in GitHub Desktop.
Programming Project 4..4
package chapter4;
import java.util.*;
public class BoxCars {
public static void main (String args[]) {
PairOfDie dice = new PairOfDie();
________________________ // define integer called boxCarCounter and set it equal to zero
for(int i = 0; i < 1000; i++){
dice.rollBothDie();
if(dice.getDieTotal() == 12)
boxCarCounter ++;
}
// Create statement that will let the user know how many box cars occured after 1000 rolls.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment