You are on page 1of 2

CSC110 Final Exam Study Sheet (ClosedBook 1st [50 Quest.], OpenBook 2nd [50 Quest.

])
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.

What kind of operator is the NOT operator? Binary or Unary?


Is the equality test for single-precision and double-precision values and variables usually reliable using = =.
A single block of code consists of a compound statement.
The statement following if (expression) is executed only if the expression evaluates to what value?
Can if-else statements contain compound statements?
Can if-else statements contain other if-else statements?
What happens when using the assignment operator, =, instead of the relational operator, ==.
A statement such as total = total + num; does what?
Once a while loop is entered, the statements within the compound statement are executed as long as the tested condition is true. Is this
correct?
What is the terminology for a loop contained within another loop?
How is each loop in a nested loop controlled?
What is our concern in creating C++ functions? Is it both the function itself and how it interacts with other functions, such as main()?
In a C++ function what are the two parts? Heading & body?
If a functions arguments are passed by value, does the function have direct access to the variables used in its arguments?
Can a called function can return more than one legitimate value to its calling function?
void getInput (int & num1); Using this prototype as an example, explain what is happening when getInput is called. Is this pass by
reference or "pass by value".
Are programmers allowed to use the same variable name in more than one function?
One-dimensional arrays are sometimes referred to as ______________.
Each item in an array is called an ___________ or ______________ of the array.
grade[5] refers to which grade stored in the grade array?
One extremely important advantage of using integer expressions as subscripts is
______________________________________________________________________________________
________________________________________________________________________________.
By using a subscript that references a nonexistent array element, does this causes an error detected by most compilers?
In the worst case for searching a list using a sequential search where would we find the desired item?
In the worst case for a binary search for a dictionary of 1,000,000 words how many searches are there?
Compare the maximum number of loop passes for a 50-item list in a binary search vs. a linear search.

Multiple Choice Section


____
____
____
____
____
____
____
____
____
____
____
____
____
____

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.

A computers ____ capability can be used to create an intelligence-like facility.


If an expression is false to begin with, then !expression is true and evaluates to a value of ____.
____ can be used to alter the assigned operator priority and improve the readability of relational expressions.
Using the abs() function requires including the ____ header file.
If age is initialized to equal 18, the statement age == 40 has a value of ____.
C++ treats any nonzero value as ____.
A Structure Chart does not show any logic, however, its purpose is to show:
It is (necessary or not) to terminate the last case in a switch statement with a break?
A(n) ____ loop is one that never ends.
Sentinel values must be selected so as not to conflict with ____.
____ loops always execute the loop statements at least once before the condition is tested.
A loop contained within another loop is called a ____ loop.
All statements in a do-while loop are executed at least ____.
A do-while statement with an expression that always evaluates to 1 causes a(n) ____, unless a break statement is encountered within the
loop.
The variable names in the parentheses of a called function are arguments that provide ____ to the called function.
A function returning a value must specify, in its header line, the ____ of the value that will be returned.
After a value is returned from a called function, program control reverts to the ____.
The misuse of globals does not apply to ____, which typically are global.
A one-dimensional array is a list of related values with the same ____ that is stored using a single group name.
The statements const int NUMELS = 4; and char code[NUMELS]; create an array with storage reserved for ____.
If an array is declared with the statements const int AA = 3; and double arrayA[AA]; the index of the last element in the array is
____.
The structure often used to sequence through an array is the ____.
The statement cin >> grade[4] >> prices[6]; causes ____ values to be read and stored.
Using a linear search, the average number of comparisons needed to find an element in an alphabetized list of length n is ____.
In a bubble sort, on each pass through the list, the largest element ____.

Open Book Portion: True/False Section (re-worded)

____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____
____

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;

You might also like