Question: second box. Enter program input (optional) Eric Chipotle 12 cars Run program Input (from above) LabProgram.java (Your program) Output (shown below) Program errors displayed here
second box. Enter program input (optional) Eric Chipotle 12 cars Run program Input (from above) LabProgram.java (Your program) Output (shown below) Program errors displayed here Exception in thread "main" java.util.NoSuchElementException: No line found at java.base/java.util.Scanner.nextLine (Scanner.java:1651) at LabProgram.main (LabProgram.java:18) Program output displayed here Enter firstName: Enter genericLocation: Coding trail of your work What is this? 2/11 F- min: 8 Feedback?
1 import java.util.Scanner; 2 3 public class LabProgram { 4 public static void main(String[] args) 5 { 6 Scanner scnr = new Scanner(System.in); 7 String firstName; 8 String genericLocation; 9 int wholeNumber; 10 String plural Noun; 11 12 System.out.println("Enter firstName: "); 13 firstName=scnr.nextLine(); 14 15 16 17 System.out.println("Enter genericLocation: "); 18 genericLocation=scnr.nextLine(); 19 20 System.out.println("Enter wholeNumber: "); 21 wholeNumber=scnr.nextInt(); 22 23 scnr.nextLine(); 24 25 26 System.out.println("Enter plural Noun: "); 27 plural Noun=scnr.nextLine()); 28 29 System.out.println(firstName + went to + genericLocation + 30 } 31.1 11 to buy + wholeNumber + " different FEB
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
