int percent = (score/numberOfQuestions)*100;
progressText.setText(score+\"/\"+numberOfQuestions+\" \"+percent+\"%\");
returns 0% no matter what I
score/numberOfQuestions
will always provide a number between 0 and 1. You have two choices depending upon how accurate you need your computation. For most things, you can change the expression to (score * 100)/numberOfQUestions
. This will give you two digits of accuracy. A problem would occur if score * 100
overflowed an int. Given your variable names, I doubt this would happen in this case. The second possibility would be to convert the expression to double for the computation.