nerdexam
Oracle

1Z0-815 · Question #26

Given: Which expression when added at line 1 will produce the output of 1.17?

The correct answer is D. float z = Math.round((float)x/y*100)/(float)100. See the full explanation below for the reasoning.

Question

Given:

Which expression when added at line 1 will produce the output of 1.17?

Exhibit

1Z0-815 question #26 exhibit

Options

  • Afloat z = (float)(Math.round((float)x/y*100)/100);
  • Bfloat z = Math.round((int)(x/y),2);
  • Cfloat z = Math.round((float)x/y,2);
  • Dfloat z = Math.round((float)x/y*100)/(float)100;

How the community answered

(27 responses)
  • A
    11% (3)
  • B
    4% (1)
  • C
    4% (1)
  • D
    81% (22)

Community Discussion

No community discussion yet for this question.

Full 1Z0-815 Practice