Slide 11
Slide 11 text
Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 11
Tutor
import java.util.Observable;
public class Tutor extends Observable {
private String [] questions = { "2 + 2",
"public or private",
"functional or not fuctional",
"white or black"
};
private String theQuestion;
public void askQuestion() {
theQuestion = questions[((int)(Math.random()*10))%4];
setChanged();
notifyObservers();
}
public String getQuestion() {
return theQuestion;
}
}