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

Given:

Which expression when added at line 1 will produce the output of 1.17?
A. float z = (float)(Math.round((float)x/y*100)/100);
B. float z = Math.round((int)(x/y),2);
C. float z = Math.round((float)x/y,2);
D. float z = Math.round((float)x/y*100)/(float)100;

Download Printable PDF. VALID exam to help you PASS.

4 thoughts on “Which expression when added at line 1 will produce the output of 1.17?

  1. public static void main(String[] args) {
    byte x = 7, y = 6;

    float z = Math.round((float)x/y*100)/(float)100;
    System.out.println(z);
    }

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.