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

1. 2. 4.The expression x *= i + j / y; is equivalent to: 5. A. Once. B. Never. C

ID: 3539402 • Letter: 1

Question

1.

2.

4.The expression

          x *= i + j / y;

is equivalent to:

5.

A. Once. B. Never. C. 49 times. D. 50 times.

2.

What is the output from the following program?

#include <iostream>
using namespace std;

void doSomething(int&, int);

int main ()
{
     int first, second;

     first = 1;
     second = 2;
     doSomething (second, first);
     cout << first << second;
     return 0;
}
void doSomething(int& thisp, int that)
{
     int theOther;
     theOther = 5;
     that = theOther + 2;
     thisp = theOther * that;
     return;
} // end doSomething
A. 35   2 B. 1   35 C. 35   7 D. 1   2 E. 1   0 3.Which of the following types cannot be the subscript type of an array? A. int B. float C. enum D. char E. None of the above.

4.The expression

          x *= i + j / y;

is equivalent to:

A. x = x * i + j / y; B. x = (x * i) + j / y; C. x = (x * i + j) / y; D. x = x * (i + j / y); E. None of the above.

5.

What is the effect of the following program segment?

for (int i = 0; i < max / 2; i++)
{
     temp = a[i];
     a[i] = a[max - i - 1];
     a[max - i - 1] = temp;
}
A. Reverses the numbers stored in the array. B. Puts the largest value in the last array position. C. Counts the number of elements of array a that are greater than its first element. D. Arranges the elements of the array in increasing order. E. None of the above. E. Until a number of 50 or larger is entered.

Explanation / Answer

50 times.
1   35
enum
x = x * (i + j / y);
Reverses the numbers stored in the array.