
public class Dice {
	//data - what information is stored
	//  data fields / fields
	//  instance variables
	//  data member
	//  member variables
	
	// how many sides
	private int sides;
	
	// what is the current value (face up)
	private int currentValue;
	
	
	//methods - what actions can we take
	
	//constructor
	// called with new
	// name must be the same as the class
	// no return type (not void)
	
	//1 parameter - number of sides
	public Dice (int s) {
		//initialize instance variables
		sides = s;
		currentValue = 1;
	}
	
	//roll the dice
	public int roll() {
		currentValue = (int)(Math.random()*sides) + 1;
		return currentValue;
	}
	
	
	//getters - accessors
	public int getCurrentValue() {
		return currentValue;
	}
	
	public int getSides() {
		return sides;
	}
	
	//setters - mutators
	public void setSides(int s) {
		if(s > 0) {
			sides = s;
		}
	}
}
