QUICK REVIEW BASIC ELEMENTS OF C++ Flashcards

1
Q

is a collection of functions.

A

C++ program

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

Every C++ program has a function called

A

main

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

starts with the pair of symbols //anywhere in the
line

A

single-line comment

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

are enclosed between /* and */

A

Multiline comments

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

The _________ skips comments.

A

compiler

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

cannot be used as identifiers in a program.

A

Reserved words

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

All ___________ in C++ consist of lowercase letters

A

reserved words

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

In C++, ________ are names of things

A

identifiers

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

A C++ identifier consists of letters, digits, and underscores and must begin with a

A

letter or underscore.

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

include blanks, tabs, and newline characters.

A

Whitespaces

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

is a set of values together with a set of operations.

A

data type

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

C++ data types fall into the following three categories:

A

simple, structured, and pointers.

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

There are three categories of simple data:

A

integral, floating-point, and enumeration.

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

Integral data types are classified into nine categories:

A

char, short, int, long, bool, unsigned char, unsigned short, unsigned int, and unsigned long.

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

The values belonging to int data type are

A

-2147483648 (-2^31) to 2147483647 (2^31 - 1)

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

The data type bool has only two values:

A

true and false

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

The most common character sets are ________, which has 128 values, and _________, which has 256 values

A

ASCII and EBCDIC

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

The ______________ of a character is its preset number in the character data set.

A

collating sequence

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

C++ provides three data types to manipulate decimal numbers:

A

float, double, and long double.

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

used in C++ to represent any real number

A

data type float

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

The memory allocated for a value of the float data type is

A

four bytes

22
Q

The memory allocated for a value of the double data type

A

eight bytes

23
Q

The arithmetic operators in C++ are

A

addition (+), subtraction (-), multiplication (*), division (/), and modulus (%)

24
Q

The ______ operator, %, takes only integer operands

25
are evaluated using the precedence rules and the associativity of the arithmetic operators.
Arithmetic expressions
26
All operands in an integral expression, or integer expression, are
integers
27
all operands in a floating-point expression are
decimal numbers
28
is an expression that consists of both integers and decimal numbers.
mixed expression
29
You can use the ____________ to explicitly convert values from one data type to another.
cast operator
30
sequence of zero or more characters.
string
31
Strings in C++ are enclosed in
double quotation marks.
32
A string containing no characters is called a
null or empty string
33
declared by using the reserved word const.
named constant
34
Only an ________________________ can change the value of a variable
assignment statement or an input (read) statement
35
In C++, >> is called the
stream extraction operator
36
Input from the standard input device is accomplished by using
cin and the stream extraction operator >>
37
When data is input in a program, the data items, such as numbers, are usually separated by
blanks, lines, or tabs
38
In C++, << is called the
stream insertion operator
39
Output of the program to the standard output device is accomplished by using
cout and the stream insertion operator <<
40
positions the insertion point at the beginning of the next line on an output device.
manipulator endl
41
The character \ is called the
escape character
42
The sequence \n is called the
newline escape sequence
43
All preprocessor commands start with the symbol
#
44
are processed by the preprocessor before the program goes through the compiler.
preprocessor commands
45
instructs the preprocessor to include the header file iostream in the program.
preprocessor command #include
46
To use cin and cout, the program must include the header file iostream and either include the statement...
using namespace std; or refer to these identifiers as std::cin and std::cout.
47
All C++ statements end with a
semicolon
48
The semicolon in C++ is called the
statement terminator
49
A C++ system has three components:
environment, language, and the standard libraries
50
are not part of the C++ language. They contain functions to perform operations, such as mathematical operations.
standard libraries
51
A file containing a C++ program usually ends with the extension
.cpp
52
are executable statements that tell the user what to do.
prompt lines