Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi All, Please I want to make sure about my solution?? 3-What is the difference

ID: 3664916 • Letter: H

Question

Hi All, Please I want to make sure about my solution?? 3-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 ____________________

4- Which statements about numeric types in Java are true? I. There is more than one integer type II. The data type float uses twice the storage of double III. The numeric range of the Java integer type is related to powers of two a. I, II b. I, III c. II, III d. I, II, III

Explanation / Answer

3. What is the difference between the result of the following two C++ statements?

I. int cents = static_cast<int>(100 * price + 0.5);

II. int cents = (100 * price + 0.5);

Answer: c. Statement I compiles, but II does not

4- Which statements about numeric types in Java are true?

Answer: d. I, II, III