Identify the error in the following code:

Private Sub btnCalculate_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnCalculate.Click
' Declare some variables
Dim sngNumber1 As Single
Dim sngNumber2 As Single
Dim sngSum As Single

' Get the two numbers
sngNumber1 = txtNumber1.Text
sngNumber2 = txtNumber2.Text
' Calculate their sngSum... is the next line working?
sngSum = sngNumber1 + sngNumber2
' Display the result
lblSum.Text = sngSum.ToString
End Sub

a. A local variable is misplaced.
b. A conversion function such as CSng was not used.
c. The variable name sngNumberl was misspelled.
d. The variable sngSum was declared as the wrong data type.

b. A conversion function such as CSng was not used.

Computer Science & Information Technology

You might also like to view...

A print job fails to leave the queue. Which of the following services may need to be restarted?

A. Printer Driver B. Windows Spool Service C. Print Spooler D. NIC driver

Computer Science & Information Technology

Which of the following is a metric that measures the average time it takes to bring a system back from failure?

a. MTTF b. MTBF c. MTTR d. All of the above are correct. e. None of the above is correct.

Computer Science & Information Technology