Identify the errors. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
ID: 3653418 • Letter: I
Question
Identify the errors. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click 'Is your program correct? Dim query, answer1, answer2 As String query = "Are you sure everything in your program is correct?" answer1 = InputBox(query) answer1 = answer1.ToUpper.Substring(0, 1) If answer1 = "N" Then txtOutput.Text = "Don't patch bad code, rewrite it." Else query = "Does your program run correctly?" answer2 = InputBox(query) answer2 = answer2.ToUpper.Substring(0, 1) If answer2 = "Y" Then txtOutput.Text = "Congratulations." Else txtOutput.Text = "Something you are sure about is wrong." End If End SubExplanation / Answer
Private Sub btnDisplay_Click(sender As Object, e As System.EventArgs) Handles btnDisplay.Click 'Is your program correct? Dim query, answer1, answer2 As String query = "Are you sure everything in your program is correct?" answer1 = InputBox(query) answer1 = answer1.ToUpper.Substring(0, 1) If answer1 = "N" Then txtOutput.Text = "Don't patch bad code, rewrite it." Else query = "Does your program run correctly?" answer2 = InputBox(query) answer2 = answer2.ToUpper.Substring(0, 1) If answer2 = "Y" Then txtOutput.Text = "Congratulations." Else txtOutput.Text = "Something you are sure about is wrong." End If End If 'Add end if End Sub