Exercise 4

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Exercise 4

Public Class Form1


Private Sub btnCheckPackage_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCheckPackage.Click
Dim weight As Integer = Val(txtWeight.Text)
Dim size As Integer = Val(txtHeight.Text) * Val(txtLength.Text) * Val(txtWidth.Text)
If weight > 27 And size > 100000 Then
Me.lblOutcome.Text = "Rejected: Too heavy and large"
ElseIf weight > 27 Then
Me.lblOutcome.Text = "Rejected: Too heavy"
ElseIf size > 100000 Then
Me.lblOutcome.Text = "Rejected: Too large"
Else
Me.lblOutcome.Text = "Accepted"
End If
End Sub
End Class

You might also like