1. Trang chủ
  2. » Công Nghệ Thông Tin

Đề thi trắc nghiệm lập trình c

115 851 1

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 115
Dung lượng 3,37 MB

Nội dung

BÀI THI TRẮC NGHIỆMDan Quayle once said, "Who’s responsible for the riots?. 20.Given the following function prototype: void fooint arr[]; Which statement correctly passes the array to th

Trang 1

BÀI THI TRẮC NGHIỆM

Dan Quayle once said, "Who’s responsible for the riots? The rioters." A

cout << "Dan Quayle once said, "Who\’s responsible for the riots? The rioters " ";

Trang 3

C

D

5.

Trang 6

variable named num?

A

cout << num;

Trang 7

the top of the program?

three integers passed in?

A

Trang 8

C

D

13.

Trang 9

3 2 2 3 B

3 2 1 1 C

3 2 1 2 D

3 2 1 3

14.

Trang 13

2 3 10 4 D

10 4 2 3

18.

A

10 4 10 4 B

2 3 10 4 C

10 4 10 3

Trang 14

X=3 Y=3 C

X=2 Y=3 D

X=2 Y=2

Trang 15

20.Given the following function prototype:

void foo(int arr[]);

Which statement correctly passes the array to the function?

int arr[10]; foo(arr[10]);

Trang 16

two-dimensional array of type double?

Trang 18

3 1 1 B

3 2 1 C

1 2 3 D

1 2 1

26.

Trang 19

int main(){

Foo f;

f->printMessage(); return 0;

Trang 20

There are no public accessor methods.

members of the structure?

struct Point {

int x;

int y;

};

Trang 22

30.Under the principle of information hiding, which class definition best encapsulated the variable named "x"?

A

B

C

Trang 23

31.

Trang 25

val1=2 val2=1 val1=2 val2=2 val1=2 val2=2 B

val1=0 val2=1 val1=0 val2=2 val1=0 val2=2

Trang 28

In default constructor Printing

35.

Trang 31

upon declaring the variable of type Foo?

Trang 32

Foo x = {1, {2}}; D

Foo x = {1, 2};

39.

A

B

Trang 33

C

D

40.

Trang 34

There should be no semicolon after the right curly brace in the

definition of the Foo class

int operator %(const Number &x, const Number &y);

Trang 37

Dan Quayle once said, "Who’s responsible for the riots? The rioters." A

cout << "Dan Quayle once said, "Who\’s responsible for the riots? The rioters " ";

Trang 42

Before foo, X=1 In foo, X=2, After foo, X=2

Trang 43

the top of the program?

Trang 44

three integers passed in?

A

Trang 45

C

D

16.

Trang 46

X=3 Y=2 B

X=3 Y=3 C

X=2 Y=2 D

X=2 Y=3

17.

Trang 47

10 4 10 3 B

10 4 2 3 C

10 4 10 4 D

2 3 10 4

18.

Trang 48

void foo(int &);

Which of the following calls would give an error message?

Trang 49

B

C

D

Trang 50

A

5 4 3 2 1 B

5 2 3 4 1 C

1 2 3 4 5 D

5 2 3 4 5

21.

Trang 51

A

B

Trang 52

C

D

all elements in the array?

Trang 53

1 2 1 B

1 2 3 C

3 1 1 D

3 2 1

24.

Trang 55

int arr[10];

D

int[11] arr;

encapsulated the variable named "x"?

A

B

Trang 56

D

27.

Trang 60

"ID" cannot be all uppercase

A

We can specify member variables to be public or private within a class, but not within a struct

B

A class allows member functions in addition to member variables while

a struct does not

Trang 62

Money m1(10,50), m2(10,50);

A

B

Trang 63

In default constructor Printing

Trang 64

In default constructor

In default constructor Printing

Printing

34.

Trang 65

val1=2 val2=1 val1=2 val2=2 val1=3 val2=2 B

val1=2 val2=1 val1=2 val2=2 val1=2 val2=2

Trang 66

val1=0 val2=1 val1=0 val2=2 val1=0 val2=2 D

val1=1 val2=1 val1=2 val2=2 val1=3 val2=2

35.

Trang 69

2 dollars and 50 cents 4 dollars and cents

upon declaring the variable of type Foo?

struct Stuff {

Trang 70

Foo x = {1, 2}; C

Foo x = {1, {2}}; D

Foo x = {1, {2}};

39.

Trang 71

A

B

C

Trang 73

There should be no semicolon after the right curly brace in the

definition of the Foo class

D

The constructor must have a return type of void in the implementation

41.

Trang 75

A 6 7 B 6 8

Trang 76

C 7 8 D 7 9

43.

Trang 77

A 8 B 10 C 15 D 30

Trang 78

BÀI THI TRẮC NGHIỆM

Trang 79

C

D

3.

Trang 82

7.How can we input a value from the keyboard and store it in the variable named num?

Dan Quayle once said, "Who’s responsible for the riots? The rioters."

Trang 84

0 1 2 3 3 B

0 1 2 3 4 1 C

0 1 2 3 4 D

0 1 2 3 1

12.

Trang 89

10 4 10 4

void foo(int &);

Which of the following calls would give an error message? A

B

C

D

18.

Trang 90

X=3 Y=2 B

X=3 Y=3 C

X=2 Y=3 D

X=2 Y=2

19.

Trang 92

void foo(int arr[]);

Which statement correctly passes the array to the function? A

int arr[10]; foo(arr[0]);

Trang 94

1 2 3 4 5 D

5 2 3 4 1

24.

A

Trang 95

B

C

D

25.

Trang 97

There are no private variables

There is a semicolon missing after the right curly brace

members of the structure?

struct Point {

int x;

int y;

};

Trang 98

Point p; p:x = 10; p:y = 20; B

Point p; p.x = 10; p.y = 20; C

Point p; p::x = 10; p::y = 20; D

Point p; p->x = 10; p->y = 20;

29.

Trang 99

encapsulated the variable named "x"?

A

Trang 100

C

D

Trang 103

Printing

Trang 104

In default constructor Printing

In default constructor Printing

C

In default constructor

In default constructor Printing

Trang 105

val1=1 val2=1 val1=2 val2=2 val1=3 val2=2 B

val1=2 val2=1 val1=2 val2=2 val1=2 val2=2

Trang 106

val1=0 val2=1 val1=0 val2=2 val1=0 val2=2 D

val1=2 val2=1 val1=2 val2=2 val1=3 val2=2

35.

Trang 108

5 5 B

10 5 C

10 10

Trang 109

upon declaring the variable of type Foo?

Trang 112

A 6 7 B 6 8

Trang 113

C 7 8 D 7 9

42.

Ngày đăng: 04/12/2015, 01:40

TỪ KHÓA LIÊN QUAN

w