2020 Dev2 Test1-Memo
2020 Dev2 Test1-Memo
MARKS : 40
INSTRUCTIONS
This is a closed book test.
No student is allowed to borrow anything from another student.
All cell phones must be switched off.
Calculators may be used but cell phones may not be used as calculators.
Answer all questions.
5) When you plan a Visual Basic program, you follow a three-step process that should end with
_______.
a. Setting the properties
b. Writing the Basic code
c. Coding all of the remark statements
d. Defining the user interface
6) After the steps for planning a Visual Basic project are completed, you can begin actually
constructing a program by _______.
a. Setting the properties
b. Creating the interface
c. Writing the code
d. Executing the next step based on the programmer's preference
8) Which of the following shows the correct order for creating a Visual Basic program?
a. Set the properties, create the interface, write the code
b. Create the interface, set the properties, write the code
c. Create the interface, write the code, set the properties
d. Write the code, set the properties, create the interface
9) The Visual Studio environment contains many different windows. Which window will be
the user interface when the project is running?
a. The Toolbox
b. The Solution window
c. The Properties window
d. The Form Designer window
10) Which window do you open if you want to see all of the objects that you can add to a form?
a. The Toolbox
b. The Solution window
c. The Properties window
d. The Form Designer
11) Which of the following statements assigns the first three characters in the strName variable
to strCode?
a. strCode = strName.Assign(0, 3)
b. strCode = strName.Sub(0, 3)
c. strCode = strName.Substring(0, 3)
d. strCode = strName.Assign(3, 1)
14) Variable declarations in event handlers begin with the keyword ______.
a. Declare
b. Dim
c. Sub
d. Integer
15) You can use the ______ instruction to terminate a running application.
a. Me.Close( )
b. Me.Displace( )
c. Me.Finish( )
d. Me.Stop( )
State the type of error in the following program and then rewrite the code without any errors.
19) The VB code below is expected to calculate the average of any two numbers. State the type
of error in the VB code below and correct the error if there is any
20) Suppose that the file Quiz1.txt is stored in the root folder of the D drive. A statement with
“C:\Quiz1.txt” filespec was executed and the program stop executing and produce a
message box with the title: FileNotFoundException was unhandled.
State the type of error and rewrite the command without any error.
What will be displayed in the message box when the following VB code is executed?
Grade D (2 marks)
20
5
6