Deck 14: Advanced Topics
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
Match between columns
Question
Match between columns
Question
Question
Question
Match between columns
Question
Question
Question
Match between columns
Question
Match between columns
Question
Match between columns
Question
Match between columns
Question
Match between columns
Question
Match between columns
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/53
Play
Full screen (f)
Deck 14: Advanced Topics
1
The decimal value of the binary number 10100 is ____.
A) 4
B) 16
C) 20
D) 32
A) 4
B) 16
C) 20
D) 32
C
2
The ____ function is used to show the size in bytes of any object or type.
A) size()
B) sizeof()
C) len()
D) length()
A) size()
B) sizeof()
C) len()
D) length()
B
3
Quick sort and pivot sort are names for recursive sorting methods.
True
4
You cannot use the address operator (&) with a bit field.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
5
The bitwise ____ operator compares the bits of its two operands, and produces a result in which each bit is a 1 if either of the operand's corresponding bits is a 1.
A) complement
B) AND
C) exclusive OR
D) OR
A) complement
B) AND
C) exclusive OR
D) OR
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
6
The bitwise ____ operator compares the individual bits of its two operands and produces a result in which each bit is a 1 where both operands contain a 1; the result is 0 in all other bit positions.
A) OR
B) AND
C) complement
D) exclusive OR
A) OR
B) AND
C) complement
D) exclusive OR
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
7
The identifiers in an enum must be unique within a block.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
8
For any number n , shifting n bits to the right is the same as multiplying by two to the n power.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
9
When a field is type ____ int , then it must be positive, because no bit is reserved for a sign, and all eight bits are used to store the value.
A) bitwise
B) short
C) positive
D) unsigned
A) bitwise
B) short
C) positive
D) unsigned
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
10
____ operators let you manipulate individual bits of integer or character values.
A) Binary
B) Unary
C) Bitwise
D) Logical
A) Binary
B) Unary
C) Bitwise
D) Logical
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
11
On many systems a(n) ____ is the amount of storage required to store a single character, such as an alphabetic letter or punctuation mark.
A) bit
B) byte
C) mask
D) enumerator
A) bit
B) byte
C) mask
D) enumerator
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
12
Separate enumerators cannot have the same value.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
13
The ____ keyword is required to declare a variable of type enumeration in C; this keyword can be omitted in C++.
A) enum
B) enumeration
C) list
D) define
A) enum
B) enumeration
C) list
D) define
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
14
The declaration ____ declares a variable named aFlag that occupies one bit of storage.
A) bool aFlag:1;
B) bit aFlag:1;
C) int aFlag(1);
D) int aFlag:1;
A) bool aFlag:1;
B) bit aFlag:1;
C) int aFlag(1);
D) int aFlag:1;
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
15
The far left bit in a byte is called the high-order bit.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
16
If you assign a value other than 0 or 1 to a bit field, ____.
A) a 0 is stored
B) a 1 is stored
C) only the far right bit is stored
D) only the far left bit is stored
A) a 0 is stored
B) a 1 is stored
C) only the far right bit is stored
D) only the far left bit is stored
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
17
For any number n , shifting n bits to the left is the same as dividing by two to the n power.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
18
Suppose value1 contains the bit pattern 10101010, value2 contains the bit pattern 00001111, and result is set to result = value1 & value2; . The value of result is ____.
A) 8
B) 10
C) 14
D) 16
A) 8
B) 10
C) 14
D) 16
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
19
The bitwise OR operator is ____.
A) &
B) &&
C) |
D) ||
A) &
B) &&
C) |
D) ||
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
20
The bitwise AND operator is ____.
A) &
B) &&
C) |
D) ||
A) &
B) &&
C) |
D) ||
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
21
Provide an example of a mechanical system that uses the decimal system.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
22
Write an enumeration Days that gives the values 0 through 6 to the identifiers SUN , MON , and so on.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
23
What happens if you use fewer than eight bits as fields in a class?
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
24
Create a Months enumeration that defines JAN as month 1 and so on.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
25
If value is set to 46, then value is ____.
A) 20
B) 23
C) 80
D) 92
A) 20
B) 23
C) 80
D) 92
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
26
In the pivot sort algorithm, some programmers prefer to use ____ as the pivot point for a sort instead of using the middle position.
A) the median
B) a random position
C) the first position
D) the last position
A) the median
B) a random position
C) the first position
D) the last position
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
27
When you declare a field to be a bit field, the field type must be int or unsigned int . Which type is preferable? Why?
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
28
The bitwise ____ operator sets each bit in the result to 1 if the corresponding bit in the operand is 0, and each bit in the result to 0 if the corresponding bit in the operand is 1.
A) AND
B) OR
C) complement
D) exclusive OR
A) AND
B) OR
C) complement
D) exclusive OR
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
29
The ____ is a memory location that holds addresses to which functions should return.
A) stack
B) queue
C) buffer
D) register
A) stack
B) queue
C) buffer
D) register
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
30
The bitwise complement operator is ____.
A) !
B) @
C) ^
D) ~
A) !
B) @
C) ^
D) ~
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
31
The ____________________ operator shifts bits to the left.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
32
The ____________________ operator shifts bits to the right.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
33
The bitwise left shift operator is ____.
A) <<
B) >>
C) <
D) >
A) <<
B) >>
C) <
D) >
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
34
When you create a class with several bit fields, in what order are the bits placed within a byte?
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
35
The bitwise right shift operator is ____.
A) <<
B) >>
C) <
D) >
A) <<
B) >>
C) <
D) >
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
36
The bitwise exclusive OR operator is ____.
A) !
B) @
C) ^
D) ~
A) !
B) @
C) ^
D) ~
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
37
Although not required by C++, by convention, a user-defined type begins with a(n) ____________________ letter.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
38
A function that calls itself is a(n) ____________________ function.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
39
All ____________________ numbers contain a 0 in the far right position.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
40
EBCDIC stands for __________________________________________________.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
41
Match between columns
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
42
Match between columns
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
43
Write a recursive function cumulativeSum() in which for any argument, num , that is passed in with a value greater than 1, the function returns a value that is num plus the cumulativeSum() of num - 1. If num is 1, it returns that value.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
44
How does the bitwise exclusive OR operator (^) work?
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
45
Match between columns
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
46
Explain a recursive "divide and conquer" approach to quickly sorting a list.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
47
In C++, is the ampersand polymorphic or not? Explain.
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
48
Match between columns
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
49
Match between columns
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
50
Match between columns
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
51
Match between columns
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
52
Match between columns
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck
53
Match between columns
Unlock Deck
Unlock for access to all 53 flashcards in this deck.
Unlock Deck
k this deck