compile error

hello, im getting a error and dont understand what it means. It says missing return statement, any ideas.
this is the code that i get the error on:
//Method: getFinalExam
      private static int getFinalExam() throws IOException
            int iReturn = -1;

            System.out.println("The Final exam is worth 100 total points");
            System.out.println("Please enter your fianl exam grade.");

            boolean bDone = false;
            while (!bDone)

            int finalExam = Integer.parseInt(Keyboard.readLine());
            if ((finalExam >= 0) && (finalExam <= 100))
                        bDone = true;
                        iReturn = finalExam;
                        System.out.println("Enter a score from 1 - 100");
            return iReturn;

Who is Participating?
OBCTConnect With a Mentor Commented:
return the iReturn outside of the while loop.
As far as the compiler is concerned, !isDone may never be true, therefore may not return.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.