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

BÀI THI TRẮC NGHIỆM LẠP TRÌNH C TRÊN LINUX

116 565 0

Đ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 116
Dung lượng 3,38 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

1.What value is stored in x after the following two statements are Dan Quayle once said, "Who’s responsible for the riots?. 20.Given the following function prototype: void fooint arr[];

Trang 1

BÀI THI TRẮC NGHIỆM LẬP TRÌNH C TRÊN LINUX

ĐỀ SỐ: 501

Trang 2

1.What value is stored in x after the following two statements are

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

3.Which of the following will output "Yes" if the integer variable num is either 2, 3, 4, or 5?

Trang 4

C

D

5.

Trang 7

variable named num?

A

cout << num;

Trang 8

the top of the program?

three integers passed in?

A

Trang 9

C

D

13.

Trang 16

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 17

two-dimensional array of type double?

Trang 20

int main(){

Foo f;

f->printMessage(); return 0;

Trang 21

There are no public accessor methods.

members of the structure?

struct Point {

int x;

int y;

};

Trang 23

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

A

B

C

Trang 24

31.

Trang 26

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 29

In default constructor Printing

35.

Trang 32

upon declaring the variable of type Foo?

Trang 34

C

D

40.

Trang 35

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 38

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 43

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

Trang 44

the top of the program?

Trang 45

three integers passed in?

A

Trang 46

C

D

16.

Trang 49

void foo(int &);

Which of the following calls would give an error message?

Trang 50

B

C

D

Trang 52

A

B

Trang 53

C

D

all elements in the array?

Trang 56

int arr[10];

D

int[11] arr;

encapsulated the variable named "x"?

A

B

Trang 57

D

27.

Trang 61

"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 63

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

A

B

Trang 64

In default constructor Printing

Trang 65

In default constructor

In default constructor Printing

Printing

34.

Trang 66

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 67

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 70

2 dollars and 50 cents 4 dollars and cents

upon declaring the variable of type Foo?

struct Stuff {

Trang 72

A

B

C

Trang 74

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 76

6 7

B

6 8

Trang 77

7 8

D

7 9

43.

Trang 79

BÀI THI TRẮC NGHIỆM

Trang 80

C

D

3.

Trang 83

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 90

10 4 10 4

void foo(int &);

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

B

C

D

18.

Trang 93

void foo(int arr[]);

Which statement correctly passes the array to the function? A

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

Trang 96

B

C

D

25.

Trang 98

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 99

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 100

encapsulated the variable named "x"?

A

Trang 101

C

D

Trang 104

Printing

Trang 105

In default constructor Printing

In default constructor Printing

C

In default constructor

In default constructor Printing

Trang 106

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 107

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 110

upon declaring the variable of type Foo?

Trang 113

6 7

B

6 8

Trang 114

7 8

D

7 9

42.

Ngày đăng: 24/09/2014, 17:40

TỪ KHÓA LIÊN QUAN

w