//*************************************************************** //A Class to represent a 6-sided Die // // Default Constructor // Mutator toss() - simulate tosing this Die // Accessor getTopFace() - answer which face of this Die is up // import java.util.Random; public class SixSidedDie { //Class Variables private static final int NUMBER_OF_FACES = 6; private static final Random tosser = new Random(); //Instance Variable: top face of the die private int topFace; //Constructor: Create a new 6-sided Die public SixSidedDie() { this.toss(); } //Mutator: toss a 6-sided Die public void toss() { this.topFace = 1 + tosser.nextInt(NUMBER_OF_FACES); } //Accessor: return the top face of the die public int getTopFace() { return this.topFace; } }