Private
Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim empid(100), hworked(100), ovthrs(100) As Integer Dim hrate(100), regpay(100), ovtpay(100), gpay(100) As Double Dim i As Integer Dim fin As IO.StreamReader = IO.File.OpenText("employee.txt")i = 0
While (fin.Peek <> -1)empid(i) = Val(fin.ReadLine)
hworked(i) = Val(fin.ReadLine)
hrate(i) = Val(fin.ReadLine)
If (hworked(i) > 40) Then
ovthrs(i) = hworked(i) - 40
ovtpay(i) = ovthrs(i) * hrate(i) * 1.5
regpay(i) = 40 * hrate(i)
Elseovthrs(i) = 0
ovtpay(i) = 0
regpay(i) = hworked(i) * hrate(i)
End Ifgpay(i) = regpay(i) + ovtpay(i)
ListBox1.Items.Add(empid(i))
ListBox2.Items.Add(FormatCurrency(ovtpay(i)))
ListBox3.Items.Add(FormatCurrency(gpay(i)))
i = i + 1
End While End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ' ListBox1.Items.Add("") ' ListBox2.Text = "" ' ListBox3.Text = "" End SubEnd
Class
