
public class Dice {

	//data:
	// fields or data fields
	// instance variables
	//  data member
	// member variable
	
	// number of sides on the die (Dice object)
	private int sides;
	
	// current value (number facing up)
	private int currentValue;
	
	
	//actions - methods
	//constructor - called using new
	// name is the same as the class
	// no return type (not void)
	public Dice(int s) {
		sides = s;
		currentValue = 1;
	}
	
	//roll the dice
	public int roll() {
		currentValue = (int)(Math.random()*sides) + 1;
		return currentValue;
	}
	
	//getters
	
	//get sides  - return the number of sides
	public int getSides() {
		return sides;
	}
	
	public int getCurrentValue() {
		return currentValue;
	}
	
	//setters
	//set the number of sides to s
	public void setSides(int s) {
		if(s > 0) {
			sides = s;
		}
	}
}
