CS 111 - Introduction to Computer Science
Homework #8


Due: Friday 3/23 at the beginning of class

1. Pig Game: In file PigGame.java, modify your two-computer simulation (PigComputerGame.java) so that one of the players is randomly chosen to be the user.  Prompt the user for decision from standard input, with an empty string (return/enter) indicating a decision to roll, and any other input line indicating a decision to hold.  An example transcript is here.

2. Pythagorean Triples: Exercise 5.21.  Call your file PythagoreanTriples.java.  To limit and avoid redundant output, assume 0 < side1 <= side2 < hypotenuse <= 500.  Print each triple space-separated on a single line.  Print triples in increasing order of side1, side2, and hypotenuse.