By using this site, you agree to our Privacy Policy and our Terms of Use. Close
nightsurge said:
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.

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.




If you drop a PS3 right on top of a Wii, it would definitely defeat it. Not so sure about the Xbox360. - mancandy
In the past we played games. In the future we watch games. - Forest-Spirit
11/03/09 Desposit: Mod Bribery (RolStoppable)  vg$ 500.00
06/03/09 Purchase: Moderator Privilege  vg$ -50,000.00

Nordlead Jr. Photo/Video Gallery!!! (Video Added 4/19/10)