Hello all, this is my first post in the forums! I have worked through this book (which I love so far, it’s a beautiful tool) and didn’t have any misunderstanding until I came across this challenge.

I created two array lists(correct answers and incorrect answers) through which the user’s answer would be appended to the list in the form of a tally.

private ListCorrect = new ArrayList<>();

private ListIncorrect = new ArrayList<>();

Each correct answer would add a tally to the “correct answers” array and an incorrect answer would add a tally to the “incorrect answers” array, then I created a new method called “check percent” that should be able to compare the two arrays and return the result of the arithmetic.

if (userPressedTrue == answerIsTrue) {

messageResId = R.string.correct_toast;

Correct.add(1);

} else {

messageResId = R.string.incorrect_toast;

Incorrect.add(1);

}

…

`public int sum_correct; { int sum = 0; for (int i : Correct) sum = sum + i; } public int sum_incorrect; { int sum = 0; for (int i : Incorrect) sum = sum + i; } public void checkPercent() { if (sum_correct + sum_incorrect == 6) { int percent_correct = (sum_correct / 6) * 100; } Toast.makeText(this, R.string.score_toast, Toast.LENGTH_LONG).show();`

I then created a string resource called “score_toast” that is supposed to show the percentage correct in decimal format:

Score: %1$d percent.

There are no apparent bugs in my code but the proper percentage does not show up in the toast nor does the toast display at the end of the program.

Is this a legitimate way to go about this problem and I’m making some small mistake, or is there a completely different, more efficient way to solve this and I’m missing it completely?

Thanks in advanced.