DEV Community

Discussion on: Train Simulation Problems

Collapse
 
vilfrim profile image
vilfrim

You are using borrowedInput.next().toUpperCase().charAt(0) method to read user input even when you are asking an integer value like in validateMaximumCapacity and validateNumberOfStations methods. In these cases you should use borrowedInput.nextInt() instead. Using borrowedInput.next().toUpperCase().charAt(0) method when you are asking a single character, like in main menu, is fine.

Thread Thread
 
sonandrew profile image
Andrew Jackson

Life saver!!! I didn’t realize I was doing that. Omg thank you. I thought I already fixed that a while ago. Well I guess that’s what you get when you copy and try to change one of your components into something else. Lol