Question 1
Question
"ThisisaVaraible" is a VAILD variable name for integer.
Question 2
Question
Select all valid Variable Name
Answer
-
SKTT1_Faker
-
Click
-
Mybase.Load
-
int
-
Integer
-
_Orz_
-
わたしがいれば十分ですよ
-
ThisisaComment
-
!Yes
-
_Cat_
Question 3
Question
Select all appropriate statement
Answer
-
sub is not a reserved word for sub-procedure
-
Integer is a kind of data type for VB
-
Load is an event handler
-
Variable name cannot contain number
-
"Benson" is not a valid variable name
Question 4
Question
What is output of following code?
Question 5
Question
What is output of following code?
Question 6
Question
Select all Valid Function Parameter Passing Method
Answer
-
byVal
-
byRef
-
參數傳落去
-
共用記憶
-
byBus
-
byTaxi
-
Value
-
Reference
Question 7
Question
Write a Complete Command for a String Variable Declaration, name is Benson, that assigned a value "A0".
[blank_start]Dim[blank_end] Benson [blank_start]As[blank_end] [blank_start]String[blank_end] [blank_start]=[blank_end] [blank_start]"A0"[blank_end]
Question 8
Question
An Event Handler is a kind of Sub-procedure.
Question 9
Question
What is out of following Code?
Question 10
Question
Select all inappropriate error types
Answer
-
syntax error
-
runtime error
-
logical error
-
Benson is really a error
-
知道自己錯乜駛你教咩
-
Spelling error
-
My life is a error
Question 11
Question
What is output of following code?
Question 12
Question
Select all suitable code for VB
Question 13
Question
Select all appropriate event handler(s) for Button
Answer
-
load
-
click
-
比利卡 比利那那 撲撲利那 比比路多
-
パメルクラルク ラリロリポップン
-
clicklaDon'twastmytime
Question 14
Question
Select all suitable control(s) for VB
Answer
-
Text Box
-
List Box
-
Group Box
-
Pizza Box
-
Input Box
-
Message Box
Question 15
Question
What is output of following code?
Dim x,y,z As Integer
x = 15
y = x + 1
z = 10 + Math.Sqrt(y)
z += Math.Round(z ^ 2)
TextBox2.Text = z
Answer
-
14
-
210
-
56280
-
compile error
Question 16
Question
Complete the code that output will identical with the calculation of equation
Dim a , b, c As Double
c = [blank_start]Math.sqrt(b^(5-2)+(a^6/b))[blank_end]
Textbox.text = c
Answer
-
Math.sqrt(b^(5-2)+(a^6/b))
-
Math.round(b^(5-2)+(a^6/b))
-
(b^(5-2)+(a^6/b))
-
Math.sqrt(b*(5-2)+(a^6/b))
-
2*Math.sqrt(b^(5-2)+(a^6/b))
Question 17
Question
A Variable able to store more than one value.
Question 18
Question
A original value will be replaced when a new value assigned to the variable.
Question 19
Question
What is output of following code?
Question 20
Question
Complete a correct syntax for the following code
Dim a,b,c As Integer
if a < b [blank_start]Then[blank_end]
c = 16
else [blank_start]if a > b Then[blank_end]
c = 17
[blank_start]else[blank_end]
c =18
[blank_start]End if[blank_end]
Answer
-
End if
-
Endif
-
else
-
otherwise
-
if a > b Then
-
a > b Then
-
a > b
-
Then
-
therefore
Question 21
Question
What is output of following code?
Question 22
Question
What is output of following code?
Answer
-
25000
-
50000
-
500
-
compile error
Question 23
Question
Rewrite the following code using for looping.
Private Sub btnDisplay_Click(...) Handles _btnDisplay.Click
Dim s As String = "stressed"
[blank_start]DisplayHeader(s)[blank_end]
[blank_start]DisplayLetter(s)[blank_end]
End Sub
Sub DisplayHeader(ByVal s As [blank_start]String[blank_end])
lstOutput.Items.Add("If you feel " & s & ", eat: ")
End Sub
[blank_start]Sub[blank_end] DisplayLetter(ByVal s As String)
For count [blank_start]As Integer[blank_end] = 1 To [blank_start]s.Length[blank_end] Step 1
lstOutput.Items.Add([blank_start]s.Substring(s.Length - count, 1)[blank_end])
[blank_start]Next[blank_end]
[blank_start]End Sub[blank_end]
Answer
-
DisplayHeader(s)
-
DisplayHeader(s,s.length)
-
DisplayLetter(s)
-
DisplayLetter(s,s.length)
-
Sub
-
Function
-
End Sub
-
EndSub
-
End Function
-
EndFunction
-
As Integer
-
As String
-
s.Length
-
7
-
s.Substring(s.Length - count, 1)
-
s.Substring(s.Length - 1, count)
-
s.Substring(count, s.Length -1)
-
String
-
Char
-
Double
-
Next
-
Loop
-
End For
-
Endfor
Question 24
Question
The Program is still executable when logical error occurred
Question 25
Question
When "Your life is a Bug" error is occurred, the program is still executable
Question 26
Question
Complete the code with following result
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [blank_start]Button1.Click[blank_end]
Dim input As String = TextBox2.Text
Dim countWord As Integer = 1
If input.Length > 0 Then
'A checking for empty input
Do While [blank_start]input.Length[blank_end] > 0
'A checking the remained words
If [blank_start]input.IndexOf(" ") <> -1[blank_end] Then
'Check occurrance of Space Bar when counting Word
input = [blank_start]input.Substring(input.IndexOf(" ") + 1)[blank_end]
'if Space Bar found, the word before the space will be "cut"
[blank_start]countWord += 1[blank_end]
'increase the word count
Else
[blank_start]input = ""[blank_end]
'when the no space remain, then clear the string
End If
Loop
Else
[blank_start]countWord = 0[blank_end]
'set the word count as zero, when no input
End If
lstOutput.Items.Add(countWord)
End Sub
Answer
-
Button1.Click
-
Button1.Load
-
Button1.二字拑羊馬
-
input.Length
-
input.Howlongisthestring
-
input.IndexOf(" ") <> -1
-
input.IndexOf(" ") Is found
-
input.Substring(input.IndexOf(" ") + 1)
-
nput.Substring(input.IndexOf(" "))
-
countWord += 1
-
countWord -= 1
-
countWord++;
-
countWord = 0
-
countWord.empty
-
input = ""
-
input.清空佢()
Question 27
Question
What is the correct syntax of "For loop"?
Answer
-
For I As Integer = 0 To 30 Step 5 ... Next
-
For I As Integer = 0 To 30 Step 5 ... Loop
-
For(int i = 0; i <= 30; i = i+5){
....
}
-
For Loop From I As Integer = 0 To 30 .... Next
Question 28
Question
What is the output of following code?
Question 29
Question
Consider the following code, What value is stored in the Variable x ?
Dim Array() As String = {"Nagato", "Shimakaze", "FubuKi", "Amatsuk"}
Dim x As Integer = Array.count
Question 30
Question
Consider the following code, What value is stored in the Variable x ?
Dim Array() As String = {"Nagato", "Shimakaze", "FubuKi", "Amatsuk"}
Dim x As Integer
For i As Integer = 1 To Array.Count - 1
x += Array(i).Length
Next
Question 31
Question
Dim Array() As String = {"Nagato", "Shimakaze", "FubuKi", "Amatsuk"}
Dim x As Integer
For i As Integer = 0 To Array.Count
x += Array(i).Length
Next
Question 32
Question
Declare a Array, Name As FourFoolWarships for storing four strings : Haruna, Kongo, Hiei, Kirishima.
[blank_start]Dim[blank_end] [blank_start]FourFoolWarships()[blank_end] [blank_start]As[blank_end] [blank_start]String[blank_end] [blank_start]=[blank_end] [blank_start]{"Haruna","Kongo","Hiei","Kirishima"}[blank_end]
Answer
-
Dim
-
Str
-
FourFoolWarships()
-
FourFoolWarships
-
As
-
Is
-
為
-
String
-
String()
-
字串序列
-
刀劍神域.序列戰爭
-
FourFoolWarships(4)
-
FourFoolWarships(3)
-
=
-
->
-
==
-
賦予
-
{"Haruna","Kongo","Hiei","Kirishima"}
-
["Haruna","Kongo","Hiei","Kirishima"]
-
"Haruna","Kongo","Hiei","Kirishima"
-
{'Haruna','Kongo','Hiei','Kirishima'}
-
Haruna,Kongo,Hiei,Kirishima
-
榛名,金剛,比叡,霧島
-
定義
-
金剛四傻(4)
Question 33
Question
Consider the following code, The Value of x is True
Dim A As Boolean = True
Dim B As Boolean = False
Dim x As Boolean = (A Or Not B) And A = -1
Question 34
Question
Consider the following code, The Value of x is False.
Dim A As Integer = 15
Dim B As Integer = 13
Dim x As Boolean = (Not (A < B) And A > 0) And (A = B + 2)
Question 35
Question
Select All Appropriate Syntax for Declaration of Function Header
Answer
-
Function Name(ByVal Variable As Integer) As String
-
string Name(int variable)
-
Dim Name(ByVal Variable As Integer) As Funciton
-
Function Name(ByVal Variable As Integer) As Character
-
Function Name(int variable) As String
-
Function Name(ByRef Variable As Integer) As String
-
Function Name(ByBus Variable As Integer) As String
-
Function Name(ByVal Variable As Married) As Single
-
None of above
Question 36
Question
Consider the following code, what value is stored in variable Answer
Dim Array() As String = {"Kamikaze","Asakaze","Harukaze","matsukaze","Hatakaze"}
Answer = Array(3).Toupper()
Answer
-
Harukaze
-
MATSUKAZE
-
HARUKAZE
-
none of above
Question 37
Question
Name all the controls in this UI
Answer
-
MyBase
-
Form
-
From
-
表格呀!
-
Label
-
StringBox
-
TextBox
-
LabelBox
-
TextLabel
-
List
-
ListLabel
-
GroupBox
-
ListBox
-
Button
-
LabelButton
-
Warspite
-
Warspite.jpg
-
PictureBox
-
PictureLabel
-
Your Wifu
-
MessageBox
Question 38
Question
The return value of string.Trim() is [blank_start]String[blank_end]
Answer
-
String
-
Character
-
Double
-
Integer
-
Nothing
-
a value
Question 39
Question
What is output of following code?
Question 40
Question
Which of following code is identical the code shown below
h /= h / 3
Question 41
Question
Are you ready for your Examination?
Question 42
Question
Complete the following code in order the have the shown result.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim Array() As Integer = {5, 6, 4, 1}
TextBox2.Text = [blank_start]CStr(Array(3))[blank_end]
End Sub
Answer
-
CStr(Array(3))
-
Array(4)
-
CStr(Array(4))
-
CStr(Array().3)
-
CInt(Array(3))
-
CArray(Array(3))
-
CStr(Array(1))
Question 43
Question
Write a code for completing following Combinations Calculation (nCr)
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Button1.Text = CStr(CombinationCalculation(CInt(N.Text), CInt(R.Text)))
End Sub
Function CombinationCalculation(ByVal n As Integer, ByVal r As Integer) As Double
Return [blank_start]Factorial(n)[blank_end] / ([blank_start]Factorial(r)[blank_end] * [blank_start]Factorial(n - r)[blank_end])
End Function
[blank_start]Function[blank_end] Factorial(ByVal num As Integer) As [blank_start]Double[blank_end]
Dim Ans As Double = 1
For count As Integer = [blank_start]num To 1[blank_end] Step -1
Ans [blank_start]*=[blank_end] count
Next
[blank_start]Return Ans[blank_end]
[blank_start]End Function[blank_end]
Answer
-
Factorial(n)
-
Factorial(r)
-
Factorial(n - r)
-
Double
-
Long
-
Integer
-
*=
-
+=
-
*
-
+
-
=
-
Return Ans
-
Return count
-
Function
-
sub
-
End Function
-
End Sub
-
num To 1
-
1 To num
Question 44
Question
The following code will cause exception when executing.
Dim Array() As Integer = {2,4,5,7}
Dim x = Array(5)
'get the number 5 in the Array
Question 45
Question
What exception caused when following code executing.
Dim Arrary(5) As Integer = {1,2,3,4,5,6}
Dim x As Integer = Array(Array.count)
Answer
-
IndexOutofRangeException
-
都唔知你問乜
-
Array Exception
-
This code is correct
Question 46
Question
We can check the largest index of the array by using "Array.count - 1" command
Question 47
Question
Return Value of Array.count of an Array(10) is 9
Question 48
Question
All output of Textbox is [blank_start]String[blank_end]
Answer
-
String
-
Character
-
Number
-
Answer
-
乜都好啦 話之佢
Question 49
Question
Which is class-level Variable?
Answer
-
ThisScropeVariable
-
int
-
classlevel
-
scopeVariable
-
None of above
Question 50
Question
Which of following Commands have looping feature in VB?