1. Expected answer: 5 Actual answer : 5 Explanation : 17 / 5 is an integer division, resulting in 3. 3 + 2 = 5. 2. Expected answer: 2 Actual answer : 2 Explanation : 31 % 5 = 1 and 31 % 6 = 1. 1 + 1 = 2. 3. Expected answer: 5.4 Actual answer : 5.4 Explanation : 17.0 / 5.0 is a floating-point division, resulting in 3.4. 3.4 + 2.0 = 5.4. 4. Expected answer: 5.4 Actual answer : 5.4 Explanation : 17 / 5.0 is a floating-point division, where 17 is cast to double, resulting in 3.4. 5. Expected answer: 5.0 Actual answer : 5.0 Explanation : 17 / 5 is an integer division, resulting in 3. 3 + 2.0 = 5.0, where the 3 is automatically cast to double. 6. Expected answer: 5.4 Actual answer : 5.4 Explanation : 17 / 5.0 = 3.4. 3.4 + 2 = 5.4, where the 2 is cast to double. 7. Expected answer: 2.0 Actual answer : 2.0 Explanation : 3 / 2 = 1 and 6 / 5 = 1. 1 + 1 = 2.0, where the total is cast to double. 8. Expected answer: 0.67 Actual answer : 0.666666666666666 Explanation : 5 / 3 = 1. 1 * 2.0 = 2.0, where 1 is cast to double. 2.0 / 3 = 0.67, where the 3 is cast to double. 9. Expected answer: 2.0 Actual answer : 2.0 Explanation : The numbers are cast to int in order to perform the modulus operation, 5 % 3 = 2, and cast back to double. 10. Expected answer: -2147483648 Actual answer : -2147483648 Explanation : 2147483647 is the max value for an int, so when 1 is added, it "wraps around" to the negative end of the range. 11. Expected answer: 0.91 Actual answer : 0.9100000000000001 Explanation : No idea. 12. Expected answer: 999999999.99999999 Actual answer : 1.0E9 Explanation : c12 is rounded off to the nearest whole number. 13. Expected answer: 16 Actual answer : 16 Explanation : 3 * 4 = 12. 4 += 12 = 16. THe expression on the right side of += is evaluated first 14. Expected answer: 24 Actual answer : 24 Explanation : 3 + 5 = 8. 3 *= 8 = 24. 15. Expected answer: 24 Actual answer : 24 Explanation : 5 + 3 = 8. 3 *= 8 = 24. 16. Expected answer: 13 Actual answer : 13 Explanation : 4++ = 5 and ++5 = 6. x16 = 6 + ++6 = 13. The + sign takes precedence over the ++ increment, thus the ++ is assumed to be a preincrement. 17. Expected answer: 12 Actual answer : 12 Explanation : x17 = ++5 + 6 = 6 + 6 = 12, where ++5 is preincremented, raising the value permanently before the second call. 18. Expected answer: Syntax error Actual answer : Syntax error Explanation : Java automatically weeds out single '='s in if statements. 19. Expected answer: False True True Actual answer : False True True Explanation : Object variables are pointers, and box191 and box192 have different memory addresses, thus ( box191 == box192 ) is false. 20. Expected answer: Syntax error Actual answer : Syntax error Explanation : There is loss of information associated with assigning a double to an int. The compiler does not let you do that. 21. Expected answer: 12.0 Actual answer : 12.0 Explanation : Doubles can take int values just fine. 22. Expected answer: -1 Actual answer : -1 Explanation : When a number is cast from double to int, the numbers after the decimal point are truncated, thus -1.9 becomes -1. 23. Expected answer: 2.0 2.0 There is no syntax error because java.lang is automatically loaded. Explanation : Math.rint() rounds a number to the nearest integer, and when it is equally close to both the upper and lower integer, it rounds to the even one. 24. Expected answer: -49 Runtime error Actual answer : -49 Runtime error Explanation : 7 * 7 * (-1)^7 = -49. System.out.println( list24[10] ); caused an array out of bounds exception, because the highest element in a 10 element array is 9. 25. Expected answer: 4 Actual answer : 4 Explanation : list25[2] = 11, list25[1] = 4, and 11 % 4 = 3. list25[3] = 0, and list25[0] = 4. 26. Expected answer: Syntax error Actual answer : Syntax error Explanation : box26 was not initialized as a new Rectangle with the new modifier. 27. Expected answer: s261: ght is coming." culture. s262: work Actual answer : s261: ght is coming." culture. s262: work Explanation : substring() with one parameter takes the part of another string from that point on. substring() with two parameters takes the part of another string between those two points.