0

Scanner doing unusual things help

Could anyone help, ive looked at this code for hours now and I cant figure out whats wrong. The problem is that the 2nd (nextFloat) scanner just "magically" skips and it says that it is an empty string, even though I didnt press anything. Also some more problems I dont even know how to describe. Basically it is a mortgage calculator. If you can help thanks https://code.sololearn.com/cDp3Dy7noUmX/?ref=app

29th Oct 2020, 6:10 PM
nikas nikis
nikas nikis - avatar
6 ответов
+ 2
It's working fine for me. Are you entering all the inputs at the same time at the input prompt? This is required for the SoloLearn playground. So for instance, enter; 107000 0.08 15 Then submit. Or 107000 0.08 15 Then submit.
29th Oct 2020, 6:24 PM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Can you provide a sample of your input and the resulting output (if any, including errors)
29th Oct 2020, 7:41 PM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Ah, that would be a localization issue. The jdk/jre will expect the input format depending on the machines current localization and language settings by default.
29th Oct 2020, 7:46 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
Oh really well anyways thanks for your help
29th Oct 2020, 9:23 PM
nikas nikis
nikas nikis - avatar
0
Well too bad for me I literally copy pasted the same code into my eclipse(also made sure there is the package thing at the top) and my problem still persists. Now its when I get to the annual interest and type in my value the program crashes...
29th Oct 2020, 7:39 PM
nikas nikis
nikas nikis - avatar
0
Thanks but I actually just fixed it. In the beginning there were just some problems with the code. But that actual thing was that I used a . to separate decimals and I shouldve used a comma Thanks for helping anyways
29th Oct 2020, 7:44 PM
nikas nikis
nikas nikis - avatar