CS 110: Visual Basic, Chapter 2

Enter your name
What is the final value of X after executing the following code?
 
Dim x As Integer
Dim y As Integer = 32
y = x
ListBox1.Items.Add(x + 2)
32
0
2
Nothing
What is the output of the following code?
 
Dim x As Integer, y As Double = 3
x += 2
y = x ^ 4 / 2
ListBox1.Items.Add(x + y)
10
317.5
Syntax error
none of the above
What is the output of the following code?
 
Dim a As Integer
Dim b As Double
a += 3 ^ 2 + 7 Mod 4 + 0.5
b += 3 ^ 2 - 7 Mod 4 + 0.1
ListBox1.Items.Add(a & " " & b)
12 6
12 6.1
12.5 6.1
13 6
What is the output of the following code?
 
Dim s As String = "Win"
Dim k As Char = "ABC"
k = s
s = k
ListBox1.Items.Add(s)
Win
ABC
A
W
According to the following declaring statement, what is the value of the variable x
 
Dim x As Char  
" "
(space)
null
none of the above
What is the output of the following code?
 
Const t As Integer = 3.2
t += 1
TextBox1.Text = t
4.2
4
3
none of the above
What is the output of the following code?

Dim a As Char = "ABCcba"
TextBox1.Text = Asc(a)
Hint: A : 65 || C : 67 || a : 97 || b : 98

Error
97
65
492
What is the output of the following code?
 
Dim visual As String = "basic"
Dim x As Integer = visual.IndexOf("i")
TextBox1.Text = x ^ 2
a) 9
b) 1
c) 4
d) 16
9
1
4
16
Division by zero is considered as a syntax error?
True
False
Which of these statements is true?
Widening means assigning a Double value to a Integer variable
No conversion function needed for narrowing
We use cdbl to convert the value into integer value
assigning a Double Value to an integer variable will lead to syntax error if option strict is set to on
{"name":"CS 110: Visual Basic, Chapter 2", "url":"https://www.quiz-maker.com/QB4GFT4","txt":"Enter your name, What is the final value of X after executing the following code?   Dim x As Integer Dim y As Integer = 32 y = x ListBox1.Items.Add(x + 2), What is the output of the following code?   Dim x As Integer, y As Double = 3x += 2y = x ^ 4 \/ 2ListBox1.Items.Add(x + y)","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker