What happens in this click event? Private Sub btnDisplay_Click(...) Handles btnD
ID: 3739187 • Letter: W
Question
What happens in this click event?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim flag As Boolean
Dim a As Integer = 10
Dim num As Integer
num = a Mod 5
Do While flag = False
a += num
If a * num <> 0 Then
flag = True
End If
Loop
txtOut.Text = CStr(a)
End Sub
an infinite loop
What is the output of following-
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim row As String = ""
For i as Integer = 1 to 9
row &= "*"
Next
txtOutput.Text = row
End Sub
DIsplays a column of nine numbers.
What should you use- if the exact number of times the loop will be executed is known before entering the loop?
Do While loop.
2 Arrays with a double datatype of 31 elements have been declared backUpArry(30) and resultsArry(30). The resultsArry() will be used for further calculations and the backUpArry() will be saved. Assign the value of resultsArry() into backUpArry().
resultsArry.CopyTo(backUpArry,0)
One hundred more items have to be added salesDataArry(). The current 101 values are important and must be maintained. Choose the correct statement to prepare the array.
redim reserve salesDataArry(200)
Private Sub btnDisplay_Click( . . . ) Handles btnDisplay.Clicked.
Dim num As Integer = 2
Dim spoon(num) As String
Spoon(0) = “soup”
Spoon(1) = “dessert”
Spoon(2) = “coffee”
txtoutput.text = spoon(num-1)
What will this output will be?
How many errors does the following code segment have?
Public Class ErroredProgram
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
a(3) As Integer
For i As Integer = 0 To 4
a(i) = i
Next
End Sub
End Class
0 errors
both a and num should be variable type doubleExplanation / Answer
According to chegg guidelines i have to solve first four bits only.
1.
num = a Mod 5
While flag = False
Correct answer a times num is not equal to 0
Option 4
2.
For i as Integer = 1 to 9 // Here loop runs from 1 to 9
row &= "*"
Displays a row of nine stars.
Option 4
3.
Option 3
4.
Option 5 correct
Arrays with a double datatype of 31 elements have been declared backUpArry(30) and resultsArry(30).
The resultsArry() will be used for further calculations and the backUpArry() will be saved.
Assign the value of resultsArry() into backUpArry().
resultsArry.CopyTo(backUpArry,0)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.