All things are lawful, but not all things are profitable.
I am getting the error missing return statment when trying to complie this
All things are lawful, but not all things are profitable.
Kelvin McDoo wrote:To handle this case more gracefully, the promptForNumOfMoves() method can be modified to make use of a try-catch block. If an exception is thrown, the catch statement can assign 0 to the number of moves, and since this is outside the range 1 to 3 the user will be prompted to try again. (Of course any integer outside the required range could be used instead of 0 but it seems a natural choice.)
Kelvin McDoo wrote:Thanks guys, I know this probably looks a easy fix but sometime when you spend hours looking at the same code your mind goes blank lol
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Don't get me started about those stupid light bulbs. |