Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Preparation for Final Exam MCQ Quiz BIG.docx
Скачиваний:
13
Добавлен:
25.02.2016
Размер:
49.93 Кб
Скачать

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

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

Question 1

Баллов: 1

The stream manipulators that format justification are_________, _________ and _______.

Выберите один ответ. a. external, internal and direct

b. left, right and internal

c. center, left and right

Question 2

Баллов: 1

What is the output of the program?

#include<iostream>

usingnamespace std;

int main() {

int a = 1;

do {

cout << a;

a+=1;

} while (a<=5);

return 0;

}

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

b. 12345

c. 13

d. 1234

e. 2345

Question 3

Баллов: 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. 0x60000000

b. 0x60000003

c. implementation defined

d. undefined

e. 0x6000000C

Question 4

Баллов: 1

The process of determining if an array contains a particular key value is called _________ the array

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

b. recursion

c. searching

d. value location

Question 5

Баллов: 1

Which of the following adds one string to the end of another?

Выберите один ответ. a. strcat();

b. stringadd();

c. ++;

d. stradd();

e. append();

Question 6

Баллов: 1

The expression ( x > y && a < b ) is true if either the expression x > y is true or the expression a < b is true

Ответ:

True

False

Question 7

Баллов: 1

What is the output of the program?

#include <iostream>

Int main(int argc, char** argv)

{

// assume address of x is 0x822222222

int x = 3;

int*& rpx = &x;

std::cout << rpx << std::endl;

return 0;

}

Выберите один ответ. a. ill-formed

b. 0x822222222

c. 3

Question 8

Баллов: 1

If we have this code:

char arr[8];

cin >> arr;

And this text is entered: Hello World , what there will be in arr ?

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

b. Hello World

c. Hello W

d. Hello

e. Other

Question 9

Баллов: 1

Which properly declares a variable of struct foo?

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

b. struct foo;

c. var foo;

d. int foo;

e. foo var;

Question 10

Баллов: 1

Lists and tables of values can be stored in __________ or __________.

Выберите один ответ. a. variables, constants

b. functions, methods

c. for, while

d. arrays, vectors

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

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

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

Question 11

Баллов: 1

Where can you put a continue statement?

Выберите один ответ. a. Everywhere in the program

b. Inside a function

c. I don’t know

d. In or as a loop body

e. In a nested loop

Question 12

Баллов: 1

Which of the following functions compares two strings?

Выберите один ответ. a. strcmp();

b. cmp();

c. compare();

d. comstr();

e. stringcompare();

Question 13

Баллов: 1

The stream insertion operator << and the stream-extraction operator >> are overloaded to handle all standard data typesincluding strings and memory addresses (stream-insertion only)and all user-defined data types.

Ответ:

True

False

Question 14

Баллов: 1

Find the error in the following program segment:

void product( void ){

int a = 0 , b = 0 , c = 0;

int result = 0;

cout << "Enter three integers: ";

cin >> a >> b >> c;

result = a * b * c;

cout << "Result is " << result;

return result;

}

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

void product( void ){

int a = 0 , b = 0 , c = 0;

int result = 0;

cout << "Enter three integers: ";

cin >> a >> b >> c;

result = a * b * c;

cout << "Result is " << result;

returnvoid;

}

b.

void product( void ){

int a = 0 , b = 0 , c = 0;

int result = 0;

cout << "Enter three integers: ";

cin >> a >> b >> c;

result = a * b * c;

cout << "Result is " << result;

return product;

}

c. All variants are correct

d. No idea

e.

void product( void ){

int a = 0 , b = 0 , c = 0;

int result = 0;

cout << "Enter three integers: ";

cin >> a >> b >> c;

result = a * b * c;

cout << "Result is " << result;

}

Question 15

Баллов: 1

Find the error in the following program segment:

int sum( int n )

{

if ( n == 0 )

return 0;

else

n + sum( n - 1 );

}

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

b. int sum( int n )

{

if ( n == 0 )

return=0;

else

return=n + sum( n - 1 );

}

c. All variants are correct

d. int sum( int n )

{

if ( n == 0 )

return 0;

else

return n + sum( n - 1 );

}

e. int sum( int n )

{

if ( n == 0 )

result 0;

else

result n + sum( n - 1 );

}

Question 16

Баллов: 1

What is the output of the program?

#include<iostream>

usingnamespace std;

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]