Visual studio 2012 multiple choice questions Refer to the code below for questio
ID: 3582592 • Letter: V
Question
Visual studio 2012 multiple choice questions
Refer to the code below for questions on this page.
1. Dim X1 As Integer = 10
2. Dim X2 As Integer = 20
3. X2 = X2 + X1
4. X1 += 10
5. X2 += X1
10
20
30 Question 2.2. What value does X2 contain at the end of line 3?
(Points : 1) 0
10
20
30 Question 3.3. What value does X1 contain at the end of line 4? (Points : 1) 10
20
30
50 Question 4.4. What value does X2 contain at the end of line 5? (Points : 1) no change.
10 more than its value at 3.
20 more than its value at 3.
30 more than its value at 3.
Explanation / Answer
1. Dim X1 As Integer = 10
2. Dim X2 As Integer = 20
3. X2 = X2 + X1
4. X1 += 10
5. X2 += X1
Question 1.1. What value does X1 contain at the end of line 3?
Answer: 10
Why?
line 1 : declare x1 variable with value 10
line 2 : declare x2 variable with value 20
line 3 : x2 will be 30 and x1 will be 10
Answer: 30
Why?
line 1 : declare x1 variable with value 10
line 2 : declare x2 variable with value 20
line 3 : x2 will be 30
Question 3.3. What value does X1 contain at the end of line 4?
Answer: 20
Why?
line 1 : declare x1 variable with value 10
line 2 : declare x2 variable with value 20
line 4: x1 will be incremented by 10 => 10 + 10 => 20
Question 4.4. What value does X2 contain at the end of line 5?
Answer: 20 more than its value at 3.
Why?
line 1 : declare x1 variable with value 10
line 2 : declare x2 variable with value 20
line 3 : x2 will be 30 and x1 will be 10
line 4: x1 will be incremented by 10 => 10 + 10 => 20
line 5: x2 will incremented by x1 i.e 20 => 30 + 20 = 50
Question 2.2. What value does X2 contain at the end of line 3?Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.