Preparation for Final Exam MCQ Quiz BIG - Попытка 1

Страница: (Назад) 1 2 3 4 5 6 7 8 9 10 (Далее)

Question41

Баллов: 1

When used, the _________ stream manipulator causes positive numbers to display with a plus sign.

Выберите один ответ.

  a. showpos  
  b. where_is  
  c. show  
  d. place  

Question42

Баллов: 1

If assumptions in the code below are true what value would be the final value printed by this program?
int main(int argc, char** argv)
{
std::cout << sizeof(int) << std::endl;

int *x = new int;

std::cout << x << std::endl;

std::cout << x + 3 << std::endl;

return 0;
}

Выберите один ответ.

  a. 0x6000000C  
  b. undefined  
  c. 0x60000003  
  d. 0x60000000  
  e. implementation defined  

Question43

Баллов: 1

An array that uses two subscripts is referred to as a (n) _________ array

Выберите один ответ.

  a. double array  
  b. no ideas  
  c. two-dimensional  
  d. multi-dimensional  

Question44

Баллов: 1

Give the function header for the following function. Function intToDouble that takes an integer argument, number, and returns a double-precision, floating-point result.

Выберите один ответ.

  a. double intToDouble(int number)  
  b. not sure  
  c. float intToDouble(int number)  
  d. int intToDouble(number)  
  e. double intToDouble(double number)  

Question45

Баллов: 1

An individual array element that is passed to a function and modified in that function will contain the modified value when the called function completes execution

Ответ:

True False

Question46

Баллов: 1

Which properly declares a variable of struct foo?

Выберите один ответ.

  a. foo;  
  b. var foo;  
  c. foo var;  
  d. struct foo;  
  e. int foo;  

Question47

Баллов: 1

What output will be produced by the following code?

int extra = 2;

if (extra < 0)

cout << "small";

else if (extra == 0)

cout << "medium";

else

cout << "large";

Выберите один ответ.

  a. None of the given choices.  
  b. small  
  c. medium  
  d. Error  
  e. large  

Question48

Баллов: 1

State the values of the variable after the calculation is performed. Assume that, when a statement begins executing, all variables have the integer value 5: product *= x++;

Result:
product =
x =

Question49

Баллов: 1

Write a C++ statement or a set of C++ statements to print the value 333.546372 in a field width of 15 characters with precisions of 1, 2 and 3. Print each number on the same line. Left-justify each number in its field.

Выберите один ответ.

  a. cin << fixed << left << setprecision(1) << setw(15) << 333.546372 << setprecision(2) << setw(15) << 333.546372 << setprecision(3) << setw(15) << 333.546372 << endl;  
  b. cout << fixed << left << setprecision(1) << setw(15) << 333.546372 << setprecision(2) << setw(15) << 333.546372 << setprecision(3) << setw(15) << 333.546372 << endl;  
  c. cout << fixed << left << setprecision(1) << 333.546372; << setprecision(2) << 333.546372; << setprecision(3) << 333.546372; << endl;  
  d. cout << fixed << left << setw(15) << 333.546372 << setw(15) << 333.546372 << setw(15) << 333.546372 << endl;  

Question50

Баллов: 1

Declare the variables c, thisIsAVariable, q76354 and number to be of type int.

Выберите по крайней мере один ответ:

  a. int c, thisIsAVariable, q76354, number  
  b. int c, thisIsAVariable, q76354, number;  
  c. int c; int thisIsAVariable; int q76354 int number;  
  d. double c, thisIsAVariable, q76354, number;  

Страница: (Назад) 1 2 3 4 5 6 7 8 9 10 (Далее)


Понравилась статья? Добавь ее в закладку (CTRL+D) и не забудь поделиться с друзьями:  



double arrow
Сейчас читают про: