Test 02 with Answer

Test 02 with Answer - COP2220 Test 2 Name: True/False...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
COP2220 Test 2 Name: True/False Indicate whether the sentence or statement is true or false. ____ 1. The expression in a C if statement may have a side effect. ____ 2. C provides two functions to convert a character from one case to another, such as from upper-case to lower-case. ____ 3. It is a good programming style to code the most probable conditions last in a series of nested if statements. ____ 4. In a post-test loop, if the test is false, no action is taken. ____ 5. The action that causes the loop terminating condition to change is known as loop termination. ____ 6. In an event-controlled loop, an event, such as reading data, changes the loop control expression from true to false. ____ 7. The "natural" loop for data validation is the do. ..while because it is a post-test loop. ____ 8. The continue statement terminates a loop and continues with the first statement after the loop. ____ 9. In a linear loop, its efficiency is proportionate to the number of iterations. ____ 10. Initializer values for an array are enclosed in brackets ([. ..]). ____ 11. It is not possible to read data directly into an array; the data must be read and then assigned to an array element. ____ 12. To pass the address of an array to a function, we prefix the array name with the address operator ____ 13. Because C passes an array to a function using its address, it is not possible to prevent the called function from changing the values in the array. ____ 14. Histogram is another term for frequency arrays. ____ 15. The bubble sort selects a value at the end of the unsorted sublist and bubbles it to its proper position in an array. ____ 16. The sequential search requires that the list be sorted. ____ 17. When a matching value is not found in the binary search, it returns an index to a value that is smaller than the search target.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
____ 18. By convention, in a two-dimensional array, the first dimension specifies the number of columns and the second specifies the number of rows. ____ 19. When passing a two-dimensional array to a function, the size of the row is required, but the number of columns is optional. ____ 20. A three-dimensional array consists of planes, rows, and columns. Multiple Choice Identify the letter of the choice that best completes the statement or answers the question. ____ 21. Which of the following is not a logical operator? a. if c. and b. not d. or ____ 22. Which of the following statements about the logical or operator is false? a. Because it is a binary operator, there are four distinct possible combinations of values. b. The or operator is false only when both operands are false. c. The or operator selects between two values. d. The expression type for an or expression is Boolean.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/01/2012 for the course COP 2220 taught by Professor Colinarchibald during the Spring '11 term at Valencia.

Page1 / 19

Test 02 with Answer - COP2220 Test 2 Name: True/False...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online