Multiple Choice
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
Correct Answer:
Verified
Q100: What is the output of the following
Q101: What is the meaning of x =
Q102: Assuming that the user enters 45 and
Q103: Assume the following variables have been declared
Q104: The problem solving process emphasizes a "first,
Q106: What happens to the fractional part when
Q107: What is the result of the following
Q108: Assuming that the user enters 23 and
Q109: What will be printed by the statements
Q110: Which of the following statements is correct