I'm trying to generate random operators in order to make the random questions have random operators, please help
public void generateNewAddQuestion () {
Random rand = new Random();
int a = rand.nextInt(21);
int b = rand.nextInt(21);
int c =0;
sumTextView.setText(Integer.toString(a) + "+" + Integer.toString(b));
locationOfCorrecAnswer = rand.nextInt(4);
answers.clear();
String[] operators = {"+", "-", "x", "/"};
int incorrectAnswer;
for (int i=0; i < 4; i++) {
if (i == locationOfCorrecAnswer) {
answers.add(a+b);
sumTextView.setText(Integer.toString(a)+"+"+Integer.toString(b));
}
else {
incorrectAnswer = rand.nextInt(41);
while(incorrectAnswer == a+b) {
incorrectAnswer = rand.nextInt(41);
}
answers.add(incorrectAnswer);
}
}
button2.setText(Integer.toString(answers.get(0)));
button3.setText(Integer.toString(answers.get(1)));
button4.setText(Integer.toString(answers.get(2)));
button5.setText(Integer.toString(answers.get(3)));
}