CIS 230 Practice Exam #2 (Ch. 5 - 7)
Part I
TRUE/FALSE
1 | Common dialog controls may be moved to any location on the form and they may be resized. |
2 | Function procedures may or may not return a value. |
3 | Global variables are visible to all forms within a project and are declared using the keyword Static. |
MULTIPLE CHOICE
4 | If a procedure will be needed in
multiple forms in a project, the procedure should be written in a
|
5 | Items can be added to a list
during run time using the _________ method.
|
6 | What is the value of j after the
code in the loop below is completed? For j = 2 to 12 Step 3 Statements in loop Next j
|
Part II
Write a code segment that performs the following tasks. Follow the precise directions and do not add prefixes to specified identifiers.
1. Write a for loop that iterates and causes the computer to beep exactly 15 times with an index variable named intCounter.
2. Write a Do Until/Loop that iterates until the variable j reaches the value of 15. A counter statement that increments j by one should be contained inside of the loop. Assume that j is assigned the value of 0 before the first statement of the loop.
3. Fill in the VB code necessary to define a general subroutine named Whatever that triples its integer argument W and displays the result in a label named lblDisplay. The argument W is passed to Whatever by value.
Private Sub Whatever( )
End Sub
4. Write a single VB statement that extracts middle name ("Jacob") from the string literal "John Jacob Jingleheimerschmidt" and displays it in the label, lblName, using the Mid string function.
5. Write a bottom-checking (posttest) indeterminant loop that iterates until the user enters the string "enuff" into a text box named txtInput. The loop should make the computer beep on each iteration.
6. Write a complete private function named sngBonus that calculates and returns the amount of 10% salary bonus applied to an argument (the employee's salary) which is passed to the function by value. The parameter should be named sngSalary and its data type is Single.
CIS 230 Home Page | Exam Information