Hey, im making an app to test grades... u click the "right button" if they got the anwser right, and the wrong button if they got it wrong...
So at the bottem there is a label, and i want it to show the total percentage you got correct... So why doesnt this code work
perRight > Should be the total percentage
varRight > # of correct anwsers
varWrong > # of wrong anwsers
so lets say i have 60 righs and 40 wrongs... it adds that and its 100.. then it divides it by total right anwsers which is 60... and i should get .60 ... then i multiply by 100 to get 60
how would i asign the % to the variable perRight?
So at the bottem there is a label, and i want it to show the total percentage you got correct... So why doesnt this code work
perRight = varRight + varWrong / varRight * 100;
perRight > Should be the total percentage
varRight > # of correct anwsers
varWrong > # of wrong anwsers
so lets say i have 60 righs and 40 wrongs... it adds that and its 100.. then it divides it by total right anwsers which is 60... and i should get .60 ... then i multiply by 100 to get 60
how would i asign the % to the variable perRight?