What is the difference between the result of the following two Java statements?
I.int cents = (int) (100 * price + 0.5) ;
II.int cents = (100 * price + 0.5) ;
A) Statement I causes truncation, but II does not
B) Statement II causes truncation, but I does not
C) Statement I compiles, but II does not
D) Statement II compiles, but I does not
Correct Answer:
Verified
Q64: What is the output of the following
Q65: Assume the following variables have been declared
Q66: Assuming that the user inputs a value
Q67: Assuming that the user inputs a value
Q68: What is the value of the var
Q70: Which of the following statements will assign
Q71: One way to avoid round-off errors is
Q72: What is the output of the following
Q73: What will be the value of the
Q74: What is the value of Math.pow(2, 3)?
A)5.0
B)6.0
C)8.0
D)9.0
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents