Can't figure out what's wrong.
I was trying to make a temperature scale converter. But everytime i got new erorr(s). This time: Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at ConverterAdvanced.main(ConverterAdvanced.java:8) Pls, help. What am I doing wrong? The code itself: import java.util.Scanner; public class ConverterAdvanced { public static void main(String[] args) { Scanner choose = new Scanner(System.in); Scanner temp = new Scanner(System.in); Double temper = temp.nextDouble(); System.out.println("Choose your scale: Cs Fh Kl"); System.out.println(choose.nextLine()); Double resCstoFh = 1.8 * temper + 32; Double resCstoKl = temper + 273.15; Double resFhtoCs = (temper - 32) * 5 / 9; Double resFhtoKl = (temper + 459.67) * 5 / 9; Double resKltoFh = temper * 1.8 - 459.67; Double resKltoCs = temper - 273.15; final String Cs = "Cs"; final String Fh = "Fh"; final String Kl = "Kl"; String choice = choose.nextLine(); try { if (Cs.equals(choice)) { System.out.println("Enter temperature:" + temp.nextDouble()); System.out.println("Fahrenheit" + resCstoFh); System.out.println("Kelvin" + resCstoKl); } else if (Fh.equals(choice)) { System.out.println("Enter temperature:" + temp.nextDouble()); System.out.println("Celsius" + resFhtoCs); System.out.println("Kelvin" + resFhtoKl); } else if (Kl.equals(choice)) { System.out.println("Enter temperature:" + temp.nextDouble()); System.out.println("Celsius" + resKltoCs); System.out.println("Fahrenheit" + resKltoFh); } } catch (Exception e) { System.out.println("Error"); } } }