Deck 2: Problem Solving Using C++
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/52
Play
Full screen (f)
Deck 2: Problem Solving Using C++
1
Programs with a structure consisting of interrelated segments, called ____ , are arranged in a logical, easily understandable order to form an integrated and complete unit.
A) blocks
B) modules
C) units
D) procedures
A) blocks
B) modules
C) units
D) procedures
B
2
Preprocessor commands end with a semicolon.
False
3
Data transmitted to a function at runtime is referred to as the ____ of the function.
A) return value
B) arguments
C) body
D) structure
A) return value
B) arguments
C) body
D) structure
B
4
Preprocessor commands begin with a ____ sign.
A) #
B) !
C) //
D) */
A) #
B) !
C) //
D) */
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
5
A(n) ____ is a word the language sets aside for a special purpose and can be used only in a specified manner.
A) codeword
B) keyword
C) identifier
D) classname
A) codeword
B) keyword
C) identifier
D) classname
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
6
The maximum number of characters in a function name is ____.
A) 128
B) 256
C) 512
D) 1024
A) 128
B) 256
C) 512
D) 1024
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
7
The main() function is referred to as a(n) ____ function because it tells other functions the sequence in which they execute.
A) logical
B) auxiliary
C) driver
D) class
A) logical
B) auxiliary
C) driver
D) class
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
8
One important requirement for designing a good function is giving it a name that conveys some idea of what the function does.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
9
The ____ is an output object that sends data it receives to the standard display device.
A) out
B) cin
C) print
D) cout
A) out
B) cin
C) print
D) cout
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
10
Omitting the parentheses after main() is a common programming error.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
11
You cannot add and subtract character data and mix it with integer data to produce useful results.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
12
C++ is a case-sensitive language.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
13
C++ provides ten built-in integer data types.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
14
Modular programs are easier to develop, correct, and modify than programs constructed in some other manner.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
15
A(n) ____ is a word designed as a memory aid.
A) mnemonic
B) keyword
C) reserved word
D) identifier
A) mnemonic
B) keyword
C) reserved word
D) identifier
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
16
____ programs are easier to develop, correct, and modify than programs constructed in some other manner.
A) Modular
B) Handwritten
C) Sequential
D) Low-level
A) Modular
B) Handwritten
C) Sequential
D) Low-level
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
17
Programs in C++ can have more than one main() function.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
18
Except for strings, double quotes, identifiers, and keywords, C++ ignores all white space.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
19
Although declaration statements can be placed anywhere in a function, typically they re grouped together and placed after the function s opening brace.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
20
A ____ contains both data and functions appropriate for manipulating the data.
A) segment
B) block
C) class
D) function
A) segment
B) block
C) class
D) function
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
21
A(n) ____ is simply a name the programmer assigns to refer to computer storage locations.
A) constant
B) variable
C) expression
D) identifier
A) constant
B) variable
C) expression
D) identifier
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
22
To determine the address of a variable, we can use C++ s address operator, ____, which means the address of.
A) *
B) =
C) &
D) !
A) *
B) =
C) &
D) !
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
23
A common programming error consists of forgetting to separate data streams sent to cout with the insertion symbol, ____.
A) <
B) >
C) >>
D) <<
A) <
B) >
C) >>
D) <<
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
24
In a function header, the ____________________ before the function name defines the type of value the function returns when it has completed operating.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
25
In C++, a module can be a class or a(n) ____________________.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
26
In an object-oriented language, such as C++, a(n) ____________________ encapsulates both data and sets of operations.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
27
The newline escape sequence is ____.
A) \l
B) \r
C) \n
D) \t
A) \l
B) \r
C) \n
D) \t
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
28
____ are explanatory remarks made in a program.
A) Comments
B) Strings
C) Escape sequences
D) Classes
A) Comments
B) Strings
C) Escape sequences
D) Classes
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
29
A(n) ____ is an item used to change how the output stream of characters is displayed.
A) manipulator
B) escape sequence
C) string
D) char object
A) manipulator
B) escape sequence
C) string
D) char object
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
30
____ in C++ are any combination of letters, numbers, and special characters enclosed in quotation marks.
A) Arrays
B) Strings
C) Enums
D) Objects
A) Arrays
B) Strings
C) Enums
D) Objects
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
31
A(n) ____ is an acceptable value for a data type.
A) primitive value
B) literal
C) built-in value
D) class value
A) primitive value
B) literal
C) built-in value
D) class value
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
32
A(n) ____ number, more commonly known as a real number, can be the number zero or any positive or negative number that contains a decimal point.
A) boolean
B) integer
C) long int
D) floating-point
A) boolean
B) integer
C) long int
D) floating-point
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
33
The three most important and common integer types used in most applications are int , char , and ____.
A) long int
B) unsigned char
C) bool
D) long
A) long int
B) unsigned char
C) bool
D) long
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
34
Each ____________________ inside the function body must end with a semicolon (;).
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
35
The C++ operator ____ provides the number of bytes used to store values for any data type named in the operator s parentheses.
A) size()
B) sizeof()
C) length()
D) lengthof()
A) size()
B) sizeof()
C) length()
D) lengthof()
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
36
When a declaration statement is used to store a value into a variable, the variable is said to be ____.
A) initialized
B) deleted
C) reserved
D) used
A) initialized
B) deleted
C) reserved
D) used
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
37
A program consists of subprograms, called ____________________, that are designed and developed to perform a specific task.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
38
A ____ begins with two slashes ( // ) and continues to the end of the line.
A) program comment
B) function comment
C) block comment
D) line comment
A) program comment
B) function comment
C) block comment
D) line comment
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
39
A(n) ____ data value is considered a complete entity and can t be decomposed into a smaller data type supported by the language.
A) composed
B) atomic
C) complex
D) real
A) composed
B) atomic
C) complex
D) real
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
40
The value stored in the variable is referred to as the variable s ____.
A) address
B) location
C) data
D) contents
A) address
B) location
C) data
D) contents
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
41
A(n) ____________________ statement names a variable and specifies the data type that can be stored in it.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
42
A(n) ____________________ data type allows negative values to be stored as well as zero and positive values.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
43
The ____________________ data type is used to store single characters.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
44
Variables used to hold single-precision values are declared by using the keyword ____________________.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
45
In C++, a(n) ____________________ is any combination of operators and operands that can be evaluated to yield a value.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
46
A(n) ____________________ is defined as a set of values and a set of operations that can be applied to these values.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
47
The output object that sends data it receives to the standard display device, or console, is called ____________________.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
48
The ____________________ and ostream classes provide the data declarations and methods used for data input and output, respectively.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
49
In C++, a(n) ____________________ character changes the normal interpretation of the character following it and alters its meaning.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
50
Every variable has three major items associated with it: its data type, the value stored in it, and its ____________________.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
51
Forgetting to enclose a string sent to ____________________ with quotation marks is a common programming error.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
52
C++ supports two types of comments: line and ____________________.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck