1 /2 /final Exam - Feb 17, 2021: Best of Luck
1 /2 /final Exam - Feb 17, 2021: Best of Luck
1 /2 /final Exam - Feb 17, 2021: Best of Luck
ID: 201911775
Name: Hussein abutayeh
Section: ___________________________________________
Instructions:
Turn off your mobile phone
Time: 9:00 – 11:00
Enquiries are only allowed during the first (15) minutes of exam time
Use the space provided. In case you need more spaces, you could use the back
of the page.
Answer all questions: Mandatory ( 2), Optional ( ), Bonus ( )
Best of Luck
AZMI EL-
ESSA
Page 1 of 6
AAO-P10-R01 3 30/9/2018
FACULTY OF ADMINISTRATIVE & FINANCIAL SCIENCES
DEPARTMENT OF M.I.S
Seq Answer
Definition
1) All variables must be declared with a name and a data type before they can T
be used in a program.
2) The != operator compares two numbers to determine if they are not equal. F
3) Arrays consist of items of different types. F
4) The value used to indicate a specific location within an array is called the F
index or subscript.
5) The following line of code is valid. T
If 90 ≤ grade ≤ 100 Then
6) A Function may return up to two values. F
7) You can display the Properties window by pressing F5. F
8) The Text property of a combo box gives the currently highlighted item. F
9) An assignment statement assigns a variable to a value. F
10) A PictureBox is Visual Basic’s control that enables you to display an image. F
11) A declaration may declare only one variable at a time. F
12) Only one CheckBox in a group can be selected at a time. T
AAO-P10-R01 3 30/9/2018
Programming with Visual Basic (02073223) 2/6
FACULTY OF ADMINISTRATIVE & FINANCIAL SCIENCES
DEPARTMENT OF M.I.S
1 How many times will Final Exam be printed when the following lines (2 points)
are executed?
Dim c As Integer = 5 19
Do
Print " Final Exam "
c += 5
Loop Until (c >= 20)
2 What is the output produced by the following segment (2 points)
last = -2
i=0 Will not print
Do While i <= last anything in
Print i; output
i=i+1
Loop
3 What is the output after executing the following program? (2 points)
Private Sub Command1_Click()
Dim x As String, y As String VB VB
x = "VB"
y = "Final"
Call exam(x, y)
Print x; " "; y
End Sub
Sub exam(x As String, y As String)
Dim temp As String
temp = x
x=y
y = temp
End Sub
4 What is the output of the following program? (2 points)
Private Sub cmdButton_Click()
Dim x As Single, y As Single, z As Single, result As Single 16
Cls
x = 2.0
y = 3.0
z = 3.0
result = Int(Norm(x, y, z))
Print result
End Sub
Private Function Norm(x As Single, y As Single, z As Single) As Single
Norm = Sqr(x^2 + y^2 + z^1)
End Function
5 How many times will AAUP be displayed when the following (2 points)
AAO-P10-R01 3 30/9/2018
Programming with Visual Basic (02073223) 3/6
FACULTY OF ADMINISTRATIVE & FINANCIAL SCIENCES
DEPARTMENT OF M.I.S
6 (2 points)
What is the output of the following?
Private Sub cmdButton_Click() 0
Dim x As Single, y As Single, z As Single
x=3
y=3
If x > y Then
z=x+y
Else
z=y-x
End If
Print z
End Sub
7 Consider the array: (2 points )
s( 0 ) = 7 9
s( 1 ) = 0
s( 2 ) = -12
s( 3 ) = 9
s( 4 ) = 10
s( 5 ) = 3
s( 6 ) = 6
Print s( s( 3 ) – s( 6 ) )
AAO-P10-R01 3 30/9/2018
Programming with Visual Basic (02073223) 4/6
FACULTY OF ADMINISTRATIVE & FINANCIAL SCIENCES
DEPARTMENT OF M.I.S
10 (4 points )
What values are placed in the array by the following statements? (Show
Element Value
each element of the array and the value for that element.)
======= ====
Dim nums (1 To 5) As Single
Dim index As Integer
nums(1 ) =5
For index = 5 To 1 step -1 nums(2 ) =8
nums(index) = 2 + index * 3 nums(3 ) =11
Next index nums(4 ) =14
nums(5 ) =17
AAO-P10-R01 3 30/9/2018
Programming with Visual Basic (02073223) 5/6
FACULTY OF ADMINISTRATIVE & FINANCIAL SCIENCES
DEPARTMENT OF M.I.S
End of Questions …… Good Luck
AAO-P10-R01 3 30/9/2018
Programming with Visual Basic (02073223) 6/6