How to retrieve multiple keyboard input in code playground?
I tried below code, it works on IntelliJ. But when I run it on Sololearn, it doesn't work (looks like the problem is keyboard input). I've been looking for solution for awhile. So, can anyone suggest me to figure out this problem? Thank you in advance Code: import java.util.Scanner; public class Main { public static double keyboardInputDouble(){ Scanner scanner = new Scanner(System.in); double doubleNumber = scanner.nextDouble(); return doubleNumber; } public static int keyboardInputInteger(){ Scanner scanner = new Scanner(System.in); int integerNumber = scanner.nextInt(); return integerNumber; } public static double calculateInterest (double amount, double interestRate){ return (amount*interestRate/100); } public static void main(String[] args) { System.out.println("Enter amount: "); int amount = keyboardInputInteger(); for (int i = 0; i <3; i++) { System.out.println("Enter "+(i+1)+" interest rate (%): "); double interest = keyboardInputDouble(); System.out.println((i+1)+" interest rate is "+interest+" %."); System.out.println("Amount "+amount+" at "+interest+" % interest = "+(int)calculateInterest(amount,interest)); } } }