Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Who can help write Visual Basic code for this problem. s radius squared slself i

ID: 3675246 • Letter: W

Question


Who can help write Visual Basic code for this problem.

s radius squared slself intselection 4 Then Else End If lbistatus . Text = "Well, okay then, g 1blstatus.Text "Your selection was not Programming Challenges 1. Larger and Smaller Create an application the that allows the user to enter two integers on a form similar to one shown in Figure 4-33. The application should determine which value is larger than the arger than the other, or it should determine that the values are equal. Before com- paring the numbers, use the Tryparse method to verify that both inputs are valid integers. If an error is found, display an appropriate message to the user. Use a Label control to display all messages. The Exit button should close the window igure 4-33 Larger and Smaller form Enter Two Integers A 12 B: 10 Roman Numeral Converter rente an annlication that allows the user to enter an integer between 1 and 10 into 2.

Explanation / Answer

Module VBModule

Public Class Form1

Private Sub button1Compare_Click( ByVal sender As System.Object , ByVal e As System.EventArgs ) Handles button1Compare.Click()

' Variables declared

Dim int_A As Integer

Dim int_B As Integer

' Variables are extracted to text

Integer.TryParse(textA.Text, int_A)

Integer.TryParse(textB.Text, int_B)

' Find which number is larger

If Not int_A Then

labelCompare.Text = (" A value isn't a number ")

ElseIf Not int_B Then

labelCompare.Text = (" B value isn't a number ")

ElseIf int_A > int_B Then

labelCompare.Text = (" A value is Greater ")

ElseIf int_A < int_B Then

labelCompare.Text = (" B value is Greater ")

ElseIf int_A = int_B Then

labelCompare.Text = (" The numbers r same ")

End If

If Not int_A Then

labelCompare.Text = (" B value isn't a number ")

End If

End Sub

Private Sub Button2Operaction_Click( ByVal sender As System.Object , ByVal e As System.EventArgs ) Handles Button2Operation.Click()

'Close the form

Me.Close()

End Sub

End Class

End Module