This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Ok, I have searched on this site, google, and I have skimmed the documentation for the Scanner... and still cannot figure out what is wrong with this. I have simplified the offending code:
No matter what I do, I cannot read any input with decimals. I can only input integers into this. If I try something like 3.11225 or even 1.1, I get this junk:
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:819)
I tried it as well, and found out that Scanner is locale sensitive. You probably use , as the decimal separator, just like me. Using 1,1 will work. I added "scan.useLocale(Locale.US);" before the call to nextDouble, and then 1.1 does work.