In: Computer Science
Please note: This is in Visual Basic.
Create an application. Add a text box, a label, and a button to the form. If the user enters a number that is greater than 100 in the text box, the button's "click" event procedure should display the result of multiplying the number by 5. Otherwise, it should display the result of dividing the number by 5. Code the procedure.
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
btn_Result.Click
Dim number As Integer
number = Convert.ToInt16(txtInput.Text)
If (number > 100) Then
lbl_output.Text = "Multiplying the " & number & " by "
& 5 & " and the result is " & number * 5
Else
lbl_output.Text = "Dividing the " & number & " by " & 5
& " and the result is " & number / 5
End If
End Sub
End Class