Multiple Choice
Assume that inputFile is a Scanner object used to read data from a text file which contains a series of double values. Select an expression to complete the following code segment, which reads the values and prints them in standard output, one per line, in a field 15 characters wide, with two digits after the decimal point. while (inputFile.hasNextDouble() )
{
Double value = inputFile.nextDouble() ;
___________________________________ // statement do display double value
}
A) System.out.printf("%15f",value) ;
B) System.out.printf("%.2f",value) ;
C) System.out.printf("%15.2f",value) ;
D) System.out.printf("%15.2f\n",value) ;
Correct Answer:

Verified
Correct Answer:
Verified
Q34: Which String class method will remove spaces
Q35: Insert the missing code in the following
Q36: Your program must read in an existing
Q37: Which of the following code snippets about
Q38: Consider the following code snippet: try<br>{<br>File inputFile
Q40: Which method of an exception object will
Q41: Which return value of the JFileChooser object's
Q42: Insert the missing code in the following
Q43: Consider the following code snippet: Scanner in
Q44: Consider the following code snippet: try<br>{<br>PrintWriter outputFile