https://github.com/ferfykins/FerfsMathGame/blob/master/src/com/company/FerfsMathGame.java(EDIT: btw don't pay attention to other classes, they're not important)
Basically, not sure what to do about this code specifically:
Code
public static int numCorrect;
public static int numWrong;
public static int totalQuestions = numCorrect + numWrong;
public static float percentCorrect = (float) numCorrect / totalQuestions;
i get NaN when getting percentCorrect variable..... also i tinkered with it
and tried this:
Code
public static int numCorrect;
public static int numWrong;
public static int totalQuestions = 1+numCorrect + numWrong;
public static int percentCorrect = numCorrect / totalQuestions;
public static float percentCorrect = (float) numCorrect / totalQuestions;
but with this i always get 0%.......
^basically niether of these ways work as it should.... trying to find correct answers % percentage.... Thanks guys
This post was edited by ferf on May 21 2020 08:11pm