Java error: cannot find symbol -
help don't know do, why i'm getting error.
score.java:44: cannot find symbol symbol : class invalidtestscore location: class score catch (invalidtestscore e) ^ 1 error // george beazer import javax.swing.*; import javax.swing.joptionpane; public class score { public static void main(string[] args) { int numberoftests = 0; double[] grade = new double[numberoftests]; double startgrade = 0; int x = 1 ; string strinput; // how many tests used strinput = joptionpane.showinputdialog(null, "how many tests have? "); numberoftests = integer.parseint(strinput); grade = new double[(int) numberoftests]; { (int index = 0; index < grade.length; index++) { strinput = joptionpane.showinputdialog(null, "enter test score." + (index + 1)); grade[index] = double.parsedouble(strinput); if (grade[index] < 0 || grade[index] > 100 ) { try { x=1; } catch (invalidtestscore e) { e.printlnstacktrace(); system.out.println ("choose test score between 0 , 100"); } } else { x=2; } { system.out.println ("choose test score between 0 , 100"); } } } while (x==1); (int index = 0; index < grade.length; index++ ) { startgrade += grade[index]; } double average = startgrade/grade.length; system.out.println("the average is: " + average); } }
it telling class invalidtestscore
not found. have import
ed it?
Comments
Post a Comment