Quiz 5 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

A ; (semicolon) is required after the closing brace of a class declaration. True or false?

A

True.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Procedural programming centers on objects and the procedures (methods) that interact with them. True or false?

A

False.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

An instance of a class (object) may be passed to a function as an argument. True or false?

A

True.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The standard library string (std::string) is a class. True or false?

A

True.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A class is a primitive datatype. True or false?

A

False

classes are defined by the user, so they are not primitive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Constructors are not required to have the same name as the class. True or false?

A

False.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Private members must be declared before public members in a class. True or false?

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Constructors may be overloaded. True or false?

A

True.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Members of a class are private by default. True or false?

A

True

members of a struct are public by default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Members of a Struct are private by default. True or false?

A

False

members of a struct are public by default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A function may return an instance of a class (object). True or false?

A

True.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

If the default constructor is forgotten, and no other constructors are defined, then the compiler will add a default constructor for you. True or false?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Object-oriented programming is centered on the procedures/actions that take place in a program instead of objects that encapsulate data and functions together. True or false?

A

False.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Structures pass by reference by default. True or false?

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

A class object may be a member of another class. True or false?

A

True.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which operator allows you to access the member of a structure or class?

A

.

17
Q

A class (object) passes by reference by default.

A

False.

18
Q

Both a structure and a class may have data members (attributes) and member functions. True or false?

A

True.

19
Q

Destructors are called when the object is destroyed (goes out of existence). True or false?

A

True.

20
Q

A structure variable may not be a member of another structure. True or false?

A

False.