Dice - CS 1050, Dr. Tucker Spring 2009

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 1050, Dr. Tucker Spring 2009 //******************************************************************** // Die.java Author: Lewis and Loftus, Java Software Solutions, 3 rd ed // Represents one die (singular of dice) with faces showing values // between 1 and the number of faces on the die. //******************************************************************** public class Die { private final int MIN_FACES = 4; private int numFaces; // number of sides on the die private int faceValue; // current value showing on the die //----------------------------------------------------------------- // Defaults to a six-sided die, initially showing 1. //----------------------------------------------------------------- public Die () { numFaces = 6; faceValue = 1; } //----------------------------------------------------------------- // Explicitly sets the size of the die. Defaults to a size of // six if the parameter is invalid. Initial face is 1....
View Full Document

Ask a homework question - tutors are online