Docsity

Midterm Exam 3 - Program Design and Development | CSCE 204, Exams of Computer Science

Toggle sidebar
bg1
Midterm Examination 3
CSCE 204 โ€“ Spring 2009
Thursday, April 16
Time: 9:30-10:20
NAME:
Multiple Choice (2 each):
1. Visual Basic automatically adds this to a list box when it contains more
items than can be displayed:
a. Larger list box
b. Scroll bar
c. Second box
d. Message box
2. What kind of loop uses a counter variable to perform the loop a specific
number of times?
a. Do Until
b. For . . . Next
c. Do While
d. If . . . Then
3. You do this to get the total number of iterations of a nested loop:
a. Add the number of iterations of all the loops
b. Multiply the number of iterations of all the loops
c. Average the number of iterations of all the loops
d. Get the number of iterations of the outermost loop
4. What kind of loop uses a counter variable to perform the loop a specific
number of times?
a. Do Until
b. For . . . Next
c. Do While
d. If . . . Then
5. What is the process of making user input is valid?
a. Syntax validation
b. User validation
c. Input validation
d. Inspection validation
pf3
pf4

Partial preview of the text

Download Midterm Exam 3 - Program Design and Development | CSCE 204 and more Exams Computer Science in PDF only on Docsity!

Midterm Examination 3

CSCE 204 โ€“ Spring 2009

Thursday, April 16

Time: 9:30-10:

NAME:

Multiple Choice (2 each):

  1. Visual Basic automatically adds this to a list box when it contains more items than can be displayed: a. Larger list box b. Scroll bar c. Second box d. Message box
  2. What kind of loop uses a counter variable to perform the loop a specific number of times? a. Do Until b. For... Next c. Do While d. If... Then
  3. You do this to get the total number of iterations of a nested loop: a. Add the number of iterations of all the loops b. Multiply the number of iterations of all the loops c. Average the number of iterations of all the loops d. Get the number of iterations of the outermost loop
  4. What kind of loop uses a counter variable to perform the loop a specific number of times? a. Do Until b. For... Next c. Do While d. If... Then
  5. What is the process of making user input is valid? a. Syntax validation b. User validation c. Input validation d. Inspection validation
  1. What control is used to gather input without placing a text box on a form? a. Input Box b. Variable c. Check Box d. Message Box
  2. What are some GUI elements? a. Objects, actions, code, and performance b. Windows, actions, menus, and hardware c. Windows, dialog boxes, buttons, and menus d. Mice, cables, keyboards, and disks.
  3. What returns a value to the part of the program that called it? a. Call b. Procedure c. Function d. Declaration
  4. The CPU only processes instructions written in: a. Machine language b. Visual Basic c. Microsoft Word d. C++
  5. A Try โ€ฆ Catch statement is useful for handling: a. Syntax errors b. Logical errors c. Runtime errors d. Hardware errors
  6. Which of the following describes the part of a program in which a variable may be used : a. Segment b. Lifetime c. Scope d. Module
  7. What type of statement causes a procedure to execute? a. Procedure declaration b. Access specifier c. Procedure call d. Step into

Short Answer (2 each):

  1. An application contains the function Square (given below). Write a statement that passes value 4 to this function and assigns its return value to a variable called intResult. Assume intResult is already declared.

Function Square (ByVal intValue As Integer) As Integer Return intValue ^ 2 End Function

  1. Write a statement that adds Spinach to the list box lstVeggies at index 2.
  2. Write an If statement that multiplies decPayRate by 1.5 when decHours is greater than 40.