CS 111 - Introduction to Computer Science
Homework #7


Due: Friday 3/10 at the beginning of class

1. Average Pig Turns:  In file AveragePigTurns.java, implement this specificationIn addition, while Scanner input/output will take place only in the main method, all solitaire game simulation and average turn computation should take place in a method getAverageTurns that takes an integer parameter for the number of games to simulate, and returns a double-precision floating-point average turn computation.  The main method will read the desired number of simulations, call method getAverageTurns with that number, and report the returned number in the specified format.  Note: You'll want to copy your PigSolitaireGame.java code as a starting point.

2. Two-Computer-Player Pig: In file PigComputerGame.java, implement this specificationNote: You'll want to copy your PigSolitaireGame.java code as a starting point.

3. Pig First Player Advantage: In file PigAdvantage.java, implement this specificationIn addition, while Scanner input/output will take place only in the main method, all solitaire game simulation and computation of the first player win probability estimate should take place in a method getAdvantage that takes an integer parameter for the number of games to simulate, and returns a double-precision floating-point first player win probability.  The main method will read the desired number of simulations, call method getAdvantage with that number, and report the returned number in the specified format.  Note: You'll want to copy your PigComputerGame.java code as a starting point.