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

Hehehe   Yeah, I hope he got my posts before too late.

By the way, I'm taking a C and Unix intro course next semester.  I always wondered what the difference in C/C+/C# or whatever actually was.  Do you have any take on this?  I am not even sure if this C course is just C or if it is C#, C+, etc.