public class CoinGame { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Player jack = new Player(); Player jill = new Player(); jill = jack; while (jack.heads < 10 & jill.heads < 10){ jack.flip(); jill.flip(); } if (jack.heads > jill.heads){ System.out.println("congratulations Jack"); } else if (jill.heads > jack.heads){ System.out.println("congratulations Jill"); } else System.out.println("tie game"); } } class Player{ int heads; Player(){ heads = 0; } public void flip(){ double x = Math.random(); if(x > 0.5){ heads++; } } }