[Solved] COMP2113 Module3-Self-Review Exercise

$25

File Name: COMP2113_Module3-Self-Review_Exercise.zip
File Size: 348.54 KB

SKU: [Solved] COMP2113 Module3-Self-Review Exercise Category: Tag:
5/5 - (1 vote)
  1. Evaluate the following expressions:
    1. 36 / 5
    2. 18 32 / 6 * 3
    3. 6 8 % 11
    4. 0 / 5
    5. 25 7 % 3 + 8 / 3
    6. 0 + 5.0 * 3.0 / 4.0
  2. Suppose x, y, and z are int variables and x = 2, y = 5, and z = 6. What is the output of each of the following statements?
    1. cout << x = << x << , y = << y << , z = << z;
    2. cout << Sum of << x << and << z << is << x + z;
    3. cout << 2 times << x << = << 2 * x;
  1. The following program has syntax mistakes. Correct them. On each successive line, assume that any preceding error has been corrected.

const char = STAR = * const int PRIME = 71; int main {

int count, sum; double x; count = 1; sum = count + PRIME; x := 25.67; newNum = count * ONE + 2; sum + count = sum; x = x + sum * COUNT;

cout << count = << count << , sum = << sum

<< , PRIME = << Prime << endl;

}

  1. Suppose a, b, and c are int variables and a = 5 and b = 6. What value is assigned to each variable after each statement executes? If a variable is undefined at a particular statement, report UND (undefined).
a b c
a = (b++) + 3;
c = 2 * a + (++b);
b = 2 * (++c) (a++);

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] COMP2113 Module3-Self-Review Exercise
$25