+ 1
How to pass values to Sololearn's Code Playground?! (Never mind an error)
I am making a program that prompts the user then receives an input then prompts the user again then receives another input. Like that: Scanner in = new Scanner(System.in); System.out.print("Enter a number: "); if (in.hasNextDouble()) { num1 = in.nextDouble(); } System.out.println(); System.out.print("Enter another number: "); if (in.hasNextDouble()) { num2 = in.nextDouble(); } System.out.println(); When I try to give two values in separate lines as Sololearn's code playground asks. It assigns the first variable successfully but not the other variable. The question is: How to pass values to Sololearn's code playground?!
1 Respuesta
+ 1
never mind in my code i didn't assign a value to num2