
CSCI 105 Introduction to Computer Programming Spring, 2009
Surprise Quiz #4
20 Points
MATCHING: For questions 1-10, select the item that best matches the description.
1. A C# statement that will perform an instruction only if a condition is true.
2. A C# statement that will perform one of two instructions depending on whether a condition is either true or
false.
3. A small rectangular box on a C# form that can be either "on" or "off".
4. One of a group of related circles on a C# form that can be selected.
5. A container that can be placed on a C# form to group components such as buttons together.
6. An example of one of these is (hour >= 40).
7. The checked attribute of a component will that this data type.
8. This is when you have if-statements used as the actions for other if-statements.
9. Multiple statements grouped together within braces.
10. Alters the sequential flow of a program. One example of these is repetition or a loop.
CHOICES:
a. block b. bool c. check box d. condition e. control structure
ab. if-statement ac. if-else-statement ad. nested if-statements ae. panel bc. radio button
MULTIPLE CHOICE:
11. What is the value of num after the following instructions are executed?
a) -2 b) -1 c) 0 d) 1 e) 2 ab) none of the above
int num = 0, x = 7;
if (x > 9)
num++;
12. What is the value of num after the following instructions are executed?
a) -2 b) -1 c) 0 d) 1 e) 2 ab) none of the above
int num = 2, x = 2;
if (num != x)
num *= 3;
13. What is the value of num after the following instructions are executed?
a) -2 b) -1 c) 0 d) 1 e) 2 ab) none of the above
int x = -1, y=0, z=1;
if (y – x == z)
num = x + y;
else
num = z * 2;
14. What is the value of num after the following instructions are executed?
a) -2 b) -1 c) 0 d) 1 e) 2 ab) none of the above
int num = 0;
if (18 % 5 > 3)
num++;
else
num--;