nightsurge said:
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. |
lol, obviously my java skills aren't up to snuff. I also didn't notice he only had 30 minutes until after I posted 
edit: I wouldn't say it is too advanced either. We did stuff like that in our intro to programming course.








