Suppose you enter 34.3 57.8 789, then press the ENTER key. Analyze the following code.
Scanner input = new Scanner(System.in);
int v1 = input.nextInt();
int v2 = input.nextInt();
String line = input.nextLine();

a. After the last statement is executed, v1 is 34.
b. The program has a runtime error because 34.3 is not an integer.
c. After the last statement is executed, line contains characters '7', '8', '9', '\n'.
d. After the last statement is executed, line contains characters '7', '8', '9'.


b See discussions in Section 12.11.3.

Computer Science & Information Technology

You might also like to view...

Write a program that reads in exactly 10 integers and outputs the sum.

What will be an ideal response?

Computer Science & Information Technology

You can use File Explorer to begin installation of a new software program

Indicate whether the statement is true or false

Computer Science & Information Technology

A screenshot is a screen capture of an open window on your computer

Indicate whether the statement is true or false

Computer Science & Information Technology

You should add a tag for each column in the table.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology