Академический Документы
Профессиональный Документы
Культура Документы
])
True/False Section slightly re-worded for topics.
____
____
____
____
____
____
____
____
____
1.
2.
3.
4.
5.
6.
7.
8.
9.
____
____
____
____
____
____
____
10.
11.
12.
13.
14.
15.
16.
____
____
____
____
____
17.
18.
19.
20.
21.
____
____
____
____
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
____
____
____
____
____
____
____
40.
41.
42.
43.
44.
45.
46.
____
____
____
____
47.
48.
49.
50.
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
Both selection and repetition statements allow the programmer to alter what?
The relationship 3 < 4 is always true, therefore the relationship has a value of ____________.
The logical operators AND, OR and NOT are used to create ______________.
Which type of operators have a higher precedence? Relational operators or logical operators?
What does the scope of the variable refer to?
In a switch statement, the keyword case is used to identify individual values that are compared to ________________________.
Can the for statement be used to construct fixed-count loops?
What does a break statement do at the end of the current loop?
When a continue statement is encountered in a while loop, where is execution immediately transferred to?
A continue statement is useful for _______________________________________ while remaining in a loop.
Is it rare or normal to initialize variables before entering the body of a repetition loop?
The for statement provides a single place for ______________________________________________________.
Is this valid for the contents of a for statement's parenthesis? (; count <= 20;)
What is the initializing list of a for statement used for? __________________________________________________________.
Are the break and continue statements allowed within a for loop?
For each single trip through the outer loop of a for statement, the inner loop runs through its entire sequence.
Do the use of function prototypes permit error-checking of data types by the compiler?
If a variable is one of the arguments in a function call, the called function receives a copy of the value stored in the variable.
Global variables allow a programmer to bypass the normal safeguards provided by functions.
Storage for all variables, except register variables, is reserved in the computers memory area.
Forgetting to include the data type of a functions parameters within the function header line is a common programming error.
Most implementations of C++ do not check the value of the index being used (called a bounds check).
Which is more complicated? Passing a complete array of values to a function or passing individual elements?
Arrays with more than two dimensions are not commonly used in C++.
What is the most efficient way to search a long, alphabetized list? A Linear Search or a Binary Search?
Multiple Choice
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
26.
27.
Like all C++ expressions, relational expressions are evaluated to yield a ____ result.
For single-precision and double-precision operands, the general expression operand_1 == operand_2 should be replaced by this
condition:
28. The postfix and prefix decrement (--) operators ____ be applied to a Boolean variable.
29. In a C++ program, statement indentation is ____ as far as the compiler is concerned.
30. In an if-else chain, the final else is ____.
31. How many case labels may be contained within a switch statement?
32. If break statements are omitted from a switch statement, how many cases following the matching case value are executed?
33. while and for statements are sometimes preferred to do-while statements because ____.
34. The ____ statement is particularly useful in filtering user-entered input and providing validity checks.
35. The equality operator should not be used when testing ____ operands.
36. The declaration statement for a function is referred to as a function ____.
37. The parentheses following a function call enclose ____.
38. The argument names in a function header are referred to as ____.
39. The minimum requirement of a stub function is that it ____ with its calling module.
40. The only requirement in creating more than one function with the same name is that the compiler must be able to determine which function to
use on the basis of the ____ of the parameters.
41. A variable with a ____ is simply one that has had storage locations set aside for it by a declaration statement made within a function body.
42. Once a global variable is created, it exists until ____.
43. If a(n) ____ technique is not used, rand() will always produce the same series of random numbers.
44. Any expression that evaluates to a(n) ____ may be used as a subscript.
45. When passing an array to a called function, the function receives ____ array.
46. If a nested loop is used to process a two-dimensional array, the inner loop corresponds to ____ elements.
47. Many compilers automatically set all elements of integer-valued and real-valued arrays to ____.
48. A linear search is also known as a(n) ____ search.
49. The value of using a binary search algorithm is that the number of elements that must be searched is ____ for each pass through the data.
Short Answer: Please handwrite your answer below this source code.
50.
After this code is executed, what is the exact output (please assume all variables are of type int)
a = 4;
b = -8; c = 12; d = 0;
if ( () && ( . ) )
cout << a is bigger and c is bigger << endl;
cout << b is bigger and d is bigger << endl;