package com.valery.crystal.ball;

import java.util.Random;

public class CrystalBall {
    // Member variables (properties about the object)
    public String[] mAnswers = {
            "It is certain!",
            "It is decidedly so!",
            "All signs say yes!",
            "The stars are not aligned!",
            "My reply is no!",
            "It is doubtful!",
            "Better not tell you now!",
            "Concentrate and ask again!",
            "Unable to answer now!",
            "It is hard to say!"};
    
    // Methods (abilities: things the object can do)
    public String getAnAnswer(){
    
        String answer = "";
        
        // Randomly select one of three answers: Yes, No, or Maybe
        // Construct a new Random number generator
        Random randomGenerator = new Random();
        int randomNumber = randomGenerator.nextInt(mAnswers.length);
        
        
        // Convert the randomNumber to a text answer
        answer = mAnswers[randomNumber];
        return answer;

    }

}

@@ -1,8 +1,150 @@
+/**%0A * FileName - CrystalBall.java%0A * Copyright (c) Valery Samovich. All rights reserved.%0A * Author: Valery Samovich%0A * Date: 2014/05/26%0A */%0A%0A
 package 

Add project comments