b)
i. (a b) && (c != 5) evaluates to false because (2 < 3) is true, but (5 != 5) is false.
c)
i. Soccer scores can be declared and initialized as an array of integers, like this: int[] scores = {2, 1, 4, 3, 0};
ii. The area of a triangle can be calculated using the formula: area = (base * height) / 2. To declare and initialize the area of a triangle, we need to know the base and height. For example, if the base is 5 and the height is 3, we can write: double area = (5 * 3) / 2;
iii. The number of days in a year is a constant value that can be declared and initialized using the keyword "final": final int DAYS_IN_YEAR = 365;
c)
i. result = x/y; evaluates to 0 because x = 4 and y = 7, so 4/7 is less than 1.
ii. result = y* 2; evaluates to 14 because y = 7, so 7 * 2 = 14.
iii. result = y + z; evaluates to 9 because y = 7 and z = 2, so 7 + 2 = 9.
d)
The output for the expression below is:
x = 6
y = ++x
PRINT x // output is 7
PRINT y // output is 7
The expression "++x" increments the value of x by 1 before assigning it to y, so y is equal to 7. When we print x, the output is also 7 because x was incremented by 1.