Answered step by step
Verified Expert Solution
Question
1 Approved Answer
These are the errors I keep getting when trying to run my code. Not sure what I am doing wrong. LAB ACTIVITY 1.17.1: Variables, input,
These are the errors I keep getting when trying to run my code. Not sure what I am doing wrong.
LAB ACTIVITY 1.17.1: Variables, input, and casting (Java) 0/5 BasicInput.java Load default template... char userChar; String userString; System.out.print("Enter Double: "); userDouble-scnr.nextDouble(); System.out.print("Enter Character: "); userChar=scnr.next().charAt(0); System.out.print("Enter String: "); userString=scnr.next(); 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 char userChar; String userString: System.out.println(userInt+" "+userDouble+" "+userChar+" "+userString); System.out.println(userString+" "+userChar+" "+userDouble+" "+user Int); System.out.println(userDouble+" cast to integer "+(int)user Double); scnr.close(); return; Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box Enter program input (optional) If your code requires input values, provide them here. Your program expects input Run program Input (from above) - BasicInput.java (Your program) Output (shown below) Program errors displayed here Exception in thread "main" java.util.NoSuchElementException at java.base/java.util.Scanner. throwFor (Scanner.java:937) at java.base/java.util.Scanner.next (Scanner.java:1594) at java.base/java.util.Scanner.nextInt (Scanner.java:2258) at java.base/java.util.Scanner.nextInt (Scanner.java:2212) at BasicInput.main (BasicInput.java:11)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started