| nordlead said: I'm not sure why you are getting your exception though. You should get a line number for the exception and look around there. 30 minutes isn't enough time to fix this unless you really know what you are doing. |
The exception comes from him using commas in the if statement. And I only used the if statements to show him how to quickly change his code and try not to confuse him or give him a solution that his professor would see as too advanced for his current stage.
Obviously in java I could do this setNumber method with one for loop and one case switch. No need to make an array of chars when you can just use the loop to call the .charAt method. Saves a step and keeps it all in Strings except for the Case Switch.







