/**
 * Class that models a magic 8-ball.
 *   @author Dave Reed
 *   @version 4/17/13
 */
public class Magic8Ball {
    private String[] possibleAnswers = {"Definitely", "No way", "Outlook hazy"};
    private Die d;
    
    /**
     * Constructs a magic 8-ball object.
     */
    public Magic8Ball() {
        this.d = new Die(this.possibleAnswers.length);
    }   
       
    /**
     * Returns an answer to the question, either "Definitely", "No way", or
     * "Outlook hazy" (with equal probability).
     * @param question the question being asked
     * @return the answer 
     */
    public String getAnswer(String question) {
        return this.possibleAnswers[this.d.roll()-1];
    }
}
