I have a little problem in my java application.
I have to calculate the score they have when they finish, I use this method:
public Float ScoreProcent(in
Float num = (float) (100 / questions * correct);
It is executed in following way:
Float num = (float) ((100 / questions) * correct);
since type of questions
and correct
is int
, values after decimal are not conisdered.
Now, 100 /questions = 100 / 38 = 2
and, num = (Float)(2 * 28)
= 76.
That's what you are getting.