by Sane Dell (1 Submission)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Thu 21st February 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Evaluates things by size and weight, customizable, useful for a few things.
API Declarations
'this program evaluates packages or items of choice by weight and size for delivering purposes
Const HEAVY As Integer = 27 'the max weight in kgs
Const BIG As Integer = 100000 'the max limit for area in cms
'this program requires 4 text boxes, 6 labels and 2 buttons, the displays can be changed to anything, and so can the number requiremnts should you want to evaluate something else.
Dim length As Double 'the length of the package
Dim height As Double 'the height of the box
Dim width As Double 'the width of the box
Dim area As Double 'and the area of the box
weight = Val(txtWeight.Text) '
length = Val(txtLength.Text) ' these codes get user input
height = Val(txtHeight.Text) '
width = Val(txtWidth.Text) '
area = length * width * height 'this gets the area
If txtLength.Text = "" And txtWidth.Text = "" And txtHeight.Text = "" And txtWeight.Text = "" Then
lblAnswer.Text = "Wow...You are an idiot. Go die!"
ElseIf txtLength.Text = "" And txtHeight.Text = "" And txtWidth.Text = "" Then
lblAnswer.Text = "Your an idiot."
ElseIf txtLength.Text = "" And txtWeight.Text = "" And txtHeight.Text = "" Then
lblAnswer.Text = "truly retarded..."
ElseIf txtLength.Text = "" And txtWidth.Text = "" And txtWeight.Text = "" Then
lblAnswer.Text = "Can you use a keyboard??"
ElseIf txtWidth.Text = "" And txtHeight.Text = "" Then
lblAnswer.Text = "Please enter a height and width"
ElseIf txtWidth.Text = "" And txtLength.Text = "" Then
lblAnswer.Text = "please enter a length and width"
ElseIf txtLength.Text = "" And txtHeight.Text = "" Then
lblAnswer.Text = "please enter a length and height"
ElseIf txtHeight.Text = "" And txtWeight.Text = "" Then
lblAnswer.Text = "please enter a weight and a height"
ElseIf txtLength.Text = "" And txtWeight.Text = "" Then
lblAnswer.Text = "Please enter a weight and a length"
ElseIf txtWidth.Text = "" And txtWeight.Text = "" Then
lblAnswer.Text = "please enter a weight and width"
ElseIf txtHeight.Text = "" Then
lblAnswer.Text = "Please enter a height"
ElseIf txtWidth.Text = "" Then
lblAnswer.Text = "please enter a weight"
ElseIf txtLength.Text = "" Then
lblAnswer.Text = "please enter a weight" 'all of this code makes it to where the program is completely aware of what gets typed into the text boxes
ElseIf txtWeight.Text = "" Then
lblAnswer.Text = "please enter a weight"
ElseIf area < BIG And weight < HEAVY Then
lblAnswer.Text = "Package is fine :)"
ElseIf area > BIG And weight < HEAVY Then
lblAnswer.Text = "Rejected!Package is too Big"
ElseIf area > BIG And weight > HEAVY Then
lblAnswer.Text = "Rejected!To Heavy And too Big"
ElseIf area < BIG And weight > HEAVY Then
lblAnswer.Text = "Rejected!Package Too Heavy"
Else : lblAnswer.Text = "GO AWAY,DUMB PERSON!!!"
End If
End Sub
Private Sub mnuiExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuiExit.Click
Application.Exit() 'ends
End Sub
Private Sub txtHeight_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtHeight.TextChanged
lblAnswer.Text = "" 'clears label
End Sub
Private Sub txtLength_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtLength.TextChanged
lblAnswer.Text = "" 'clears label
End Sub
Private Sub txtWeight_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtWeight.TextChanged
lblAnswer.Text = "" 'clears label
End Sub
Private Sub txtWidth_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtWidth.TextChanged
lblAnswer.Text = "" 'clears label
End Sub
No comments have been posted about Evaluates things by size and weight, customizable, useful for a few things.. Why not be the first to post a comment about Evaluates things by size and weight, customizable, useful for a few things..