DESCRIPTION:
Click Button1 Find out the avg. of four values,click Button2 find minimum number,click Button3 find maximum number using with Subroutine of function.
PROPERTIES:
CODEING:
Click Button1 Find out the avg. of four values,click Button2 find minimum number,click Button3 find maximum number using with Subroutine of function.
PROPERTIES:
Button1 | |
Text | Average |
Button2 | |
Text | Max |
Button3 | |
Text | Min |
Lable1 | |
Text | Select Button |
Public Class Form1
Dim arry(3) As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
For i As Integer = 0 To 3
arry(i) = InputBox("Input Only Numeric Value")
Next i
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
avg(arry)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
max(arry)
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
min(arry)
End Sub
Sub avg(ByVal ParamArray a() As Integer)
Label1.Text = "Average : " & a.Average()
End Sub
Sub max(ByVal ParamArray a() As Integer)
Label1.Text = "Maximum :" & a.Max()
End Sub
Sub min(ByVal ParamArray a() As Integer)
Label1.Text = "Minimum :" & a.Min()
End Sub
End Class
DESIGNING:Dim arry(3) As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
For i As Integer = 0 To 3
arry(i) = InputBox("Input Only Numeric Value")
Next i
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
avg(arry)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
max(arry)
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
min(arry)
End Sub
Sub avg(ByVal ParamArray a() As Integer)
Label1.Text = "Average : " & a.Average()
End Sub
Sub max(ByVal ParamArray a() As Integer)
Label1.Text = "Maximum :" & a.Max()
End Sub
Sub min(ByVal ParamArray a() As Integer)
Label1.Text = "Minimum :" & a.Min()
End Sub
End Class
Comments
Post a Comment