+ 1
Code not running properly - Java
Would you guys help me? Could anyone tell me why this code isn't working properly? https://code.sololearn.com/cjEoeRi2LOm6 When it's run the following error shows up: Enter first number: Enter Second number: Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at apples.main(apples.java:10) I couldn't figure it out
2 Respuestas
+ 6
For Java on Code Playground you have to input everything at once when prompted.
Try putting numbers into the input box like this:
5
9.5
Answer will be 14.5. Which is correct.
+ 4
It's working fine!