Use the following below to answer questions1 & 2: import java.util.Scanner; publ
ID: 3614005 • Letter: U
Question
Use the following below to answer questions1 & 2:import java.util.Scanner;
public class Lab3_Ex1
{
public static void main (String [] args)
{
Scanner keyboard = new Scanner(System.in);
float x;
int y;
char ch1, ch2;
String name;
String input;
System.out.print( "Enter a character: ");
input = keyboard.next();
ch1 = input.charAt(0);
System.out.print( "Enter a number: ");
y = keyboard.nextInt();
System.out.print( "Enter another character:");
input = keyboard.next();
ch2 = input.charAt(0);
System.out.print( "Enter a name:"); name = keyboard.next();
System.out.print( "Enter a floating point value:");
x = keyboard.nextFloat();
System.out.println(" ch1 = " + ch1);
System.out.println( "y = " + y);
System.out.println( "ch2 = " + ch2);
System.out.println( "Name is " + name);
System.out.println( "x = " + x);
System.exit(0);
}
}
Run the above program using the following sets of data and answerthe
questions below. Type your answers into a text file, name thefile
“Lab3_Ex1_output” and upload the file to ELearning.
1. Enter x 1234 y john 10.50
press the enter key
Why did all the prompts after the first one run together and notstop for you
to enter data?
2. Enter 1 89 j 110.50
press the enter key
What is the computer waiting for?
Enter a 1, then explain why the data is the way it is.