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

A

modulus

25
Q

are evaluated using the precedence rules and the
associativity of the arithmetic operators.

A

Arithmetic expressions

26
Q

All operands in an integral expression, or integer expression, are

A

integers

27
Q

all operands in a floating-point expression are

A

decimal numbers

28
Q

is an expression that consists of both integers and
decimal numbers.

A

mixed expression

29
Q

You can use the ____________ to explicitly convert values from one data type to another.

A

cast operator

30
Q

sequence of zero or more characters.

A

string

31
Q

Strings in C++ are enclosed in

A

double quotation marks.

32
Q

A string containing no characters is called a

A

null or empty string

33
Q

declared by using the reserved word const.

A

named constant

34
Q

Only an ________________________ can change the value of a variable

A

assignment statement or an input (read) statement

35
Q

In C++,&raquo_space; is called the

A

stream extraction operator

36
Q

Input from the standard input device is accomplished by using

A

cin and the stream extraction operator&raquo_space;

37
Q

When data is input in a program, the data items, such as numbers, are usually separated by

A

blanks, lines, or tabs

38
Q

In C++, &laquo_space;is called the

A

stream insertion operator

39
Q

Output of the program to the standard output device is accomplished by using

A

cout and the stream insertion operator «

40
Q

positions the insertion point at the beginning of the
next line on an output device.

A

manipulator endl

41
Q

The character \ is called the

A

escape character

42
Q

The sequence \n is called the

A

newline escape sequence

43
Q

All preprocessor commands start with the symbol

A

#

44
Q

are processed by the preprocessor before the program goes through the compiler.

A

preprocessor commands

45
Q

instructs the preprocessor to include the header file iostream in the program.

A

preprocessor command #include <iostream></iostream>

46
Q

To use cin and cout, the program must include the header file iostream and either include the statement…

A

using namespace std; or refer to these
identifiers as std::cin and std::cout.

47
Q

All C++ statements end with a

A

semicolon

48
Q

The semicolon in C++ is called the

A

statement terminator

49
Q

A C++ system has three components:

A

environment, language, and the standard libraries

50
Q

are not part of the C++ language. They contain functions
to perform operations, such as mathematical operations.

A

standard libraries

51
Q

A file containing a C++ program usually ends with the extension

A

.cpp

52
Q

are executable statements that tell the user what to do.

A

prompt lines