Ch. 2: Introduction to C++ Ch. 2.1: The Parts of a C++ Program Flashcards

1
Q

What operator is used for writing a comment?

A

// marks the beginning of a comment. The compiler ignores everything from the double slash to the end of the line.

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

What does a preprocessor directive code start with?

A

A #. I.e. #include

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

What is the <iostream> header file?</iostream>

A

The brackets < > indicate it is a standard C++ program to display output on the screen and read input on the keyboard.

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

What is a namespace?

A

Used to organize names of program entities.

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

What does namespace std mean?

A

Declares the program will be accessing entities whose names are part of the namespace called std.

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

What is a function?

A

One or more programming statements that collectively have a name.

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

What is a string literal or a string constant?

A

Group of characters inside quotation marks.

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

What does a // do?

A

Marks the beginning of a component.

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

What does a pound sign indicate?

A

Marks the beginning of a preprocessor directive.

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

What do opening “<” and closing “>” brackets indicate?

A

Enclose a filename when used with a #include directive.

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

What do opening “(“ and closing “)” parenthesis indicate?

A

Used in naming a function, as in int main().

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

What do opening “{“ and closing “}” braces mean?

A

Enclose a group of statements, such as the contents of a function.

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

What do opening and closing quotation marks indicate?

A

Enclose a string of characters, such as a message that is to be printed on the screen.

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

What does a semicolon indicate?

A

Marks the end of a complete programming statement.

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