Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

both a and num should be variable type double
When loop out, flag = false
a should be variable type double
a times num is not equal to 0

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 row of ten stars.
DIsplays a row of ten numbers.
Displays a column of ten stars.
None of the above.

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?

For Next loop.
Do Until loop.
For Until loop.
Do 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().

backUpArry() = resultsArry(30)
backUpArry(30) = resultsArry
None of the above
backUpArry() = resultsArry()

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.

none of the above
dim preserve salesDataArry(200)
redim preserve salesDataArry(200)
dim reserve salesDataArry(200)

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

2 errors
3 errors
1 error
4 errors

0 errors

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions