Ask the Wizard


the_customer.java

public class the_customer extends ask_the_wizard {
	String the_answer;	
	public void what_is_my_fortune(String s) {
		the_answer=s;
	}
	
	public void tell_answer() {
		System.out.println(the_answer);
	}
}

ask_the_wizard.java

import java.util.*;
public class ask_the_wizard {
    String[] ans= new String [3];
    
 	public ask_the_wizard() {
	ans[0]=new String("Play powerball.");
	ans[1]=new String("Tryout for the Rams.");
	ans[2]=new String("Stick to Java programming.");
 	}
  	
	public void getCookee() {
     	String s;
	    Random rand=new Random();
    	s=ans[rand.nextInt(3)];
	    what_is_my_fortune(s);
  	}
	
	public void what_is_my_fortune(String s) {
	}

}

Fortunes.java


public class Fortunes{

  public static void main(String args[]){
 	the_customer customer=new the_customer();
    customer.getCookee();
    customer.tell_answer();
  }
  
  
 }