Selected Midterm Questions

Both Day and evening Sections Combined

1. Which of the following is a valid identifier?

  1. double
  2. big-number
  3. 50Percent
  4. Sales_Tax

More information: Lesson 2.4.5.

2. The first calculation performed in the expression 3 + 2 * 5 - 2 / (2 + 3 * 5 % 2) is

  1. 3 + 2
  2. 2 * 5
  3. 3 * 5
  4. 5 % 2

More information: Lesson 3.1.2.

3. What is the output from the following loop:

int i = 10;
while (i >= 0)
   cout << i << endl;
   i--;
  1. No output
  2. The numbers 0 through 10 will be output
  3. The number 10 will be output exactly one time
  4. The number 10 will be output infinitely

More information: Lesson 4.3.5