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 perfect hashing function

a) maps elements of the same size to the same position in the hash table b) maps elements to the next sequentially available space in the hash table c) maps elements of the same class to the same position in the hash table d) maps each element to a unique position in the hash table e) is not possible

Computer Science & Information Technology

Melanie is writing an article for the school newspaper. Her editor assigned her a maximum length; however, Melanie has some strong opinions she would like to express.Melanie has five strong points to make in her article and she wants to be sure they stand out from the body of the text. The best way to do this is to select the text that make these points and click the ____ button from the Paragraphs group on the Home tab of the ribbon.

A. Bold B. Italics C. Increase Font Size D. Bulleted List

Computer Science & Information Technology

The ____________________ role is used to enable client computers to run services and software applications on the server instead of on the client.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which type of computer activity would likely be assigned to the priority queue?

A. a background process that defragments the disk B. sending email C. mouse movement D. a background process that releases unused memory blocks

Computer Science & Information Technology