Post Lab 9: Rolling a Pair of Dice

Due Friday, November 12, 2010

In this assignment you will write a PairOfDice class (in file PairOfDice.java) and then use it in a program (PlayGame.java) with a loop.

The PairOfDice class must meet the following specifications:

Instance data: Two Die objects (die1 and die2). You need to save the class Die.java from your textbook (it is on pages 168 - 169 - an example program that uses Die objects is on page 167). Do not change Die.java - just use it. For example, you will declare the two instance variables die1 and die2 to be of type Die in your PairOfDice class.

Methods:

Write a program PlayGame that does the following:


Submission

From your postlab9 directory, tar your code using the command:

   tar czf username.tgz *
Where username is the name you use to log into the lab machines.

To submit your code, copy the tar file containing your code to the directory:

   ~bouchard/cpsc120/post9