Exam 2: Console Input and Output

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

What does the following code output? DecimalFormat dfQuestion = new DecimalFormat("#0.##E0"); System.out.println(dfQuestion.format(12.7896987));

(Multiple Choice)
4.8/5
(40)

The class NumberFormat allows you to specify a constant representing which country's currency format should be used.To use this constant you must import:

(Multiple Choice)
4.8/5
(29)

The new line character is represented as '\n'.

(True/False)
4.8/5
(34)

Write a Java statement to create and initialize a Scanner object named input.

(Short Answer)
4.8/5
(31)

Valid arguments to the System.out object's println method include:

(Multiple Choice)
4.9/5
(40)

What do the format specifiers d,f,e,g,s and c represent?

(Essay)
4.9/5
(38)

Write Java statements to apply currency formatting to the number 100.Indicate the package you need to import.

(Essay)
4.9/5
(35)

Every Java program automatically imports the java.util package.

(True/False)
4.9/5
(34)

What does the following code output? DecimalFormat percent = new DecimalFormat("0.00%"); System.out.println(percent.format(0.308));

(Multiple Choice)
4.8/5
(39)
Showing 21 - 29 of 29
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)