If you want to follow my advice and use
next() you would need to use
Double.parseDouble to get the value.
IMO it is better approach as
Double.parseDouble ignores the Locale and always uses a dot.
If you want do use nextDouble() you need to make sure that you pass a locale that uses a dot as a decimal separator to your Scanner.
John Brendan wrote:Could you provide the code listing?
Nope,
we are not a code mill ;)
I already provided you what method to use. You need to write your code yourself.