Public Class Form1 '//////////////CREATED BY ZEKI OZYILMAZ for CST112 Private Sub BPay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BPay.Click 'Shows the paystub and paycheck of the person's data entered in text boxes. 'Step0. Declarations Dim hours, grosspay, payrate As Double Dim n, employnum As Integer Dim fullname, firstname, lastname As String 'Step1. Input employnum = Val(Tnum.Text) payrate = Val(Trate.Text) hours = Val(Thour.Text) fullname = Tnam.Text n = fullname.IndexOf(" ") firstname = fullname.Substring(0, n) lastname = fullname.Substring(n + 1) 'Step2. Process If hours > 40 Then 'checks for overtime grosspay = (hours - 40) * 1.5 * payrate + 40 * payrate Else grosspay = hours * payrate End If 'Step3. Output 'outputs paycheck and paystub paystub(employnum, lastname, firstname, payrate, hours, grosspay) paycheck(fullname, grosspay) End Sub Private Sub BExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BExit.Click Me.Close() 'Closes the form End Sub Private Sub BNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BNext.Click nxt() 'button to clears the text boxes, paystub, and paycheck End Sub Sub nxt() 'process that clears text boxes, paystub and paycheck Lpaystub.Items.Clear() LNam.Text = ("") Lamount.Text = ("") Tnum.Text = ("") Trate.Text = ("") Thour.Text = ("") Tnam.Text = ("") End Sub Sub paystub(ByVal employnum As Integer, ByVal lastname As String, ByVal firstname As String, ByVal payrate As Double, ByVal hours As Double, ByVal grosspay As Double) 'Output of paystub With Lpaystub.Items .Clear() .Add("Empolyee Number: " & employnum) .Add("Last name: " & lastname) .Add("First name: " & firstname) .Add("Hourly rate: $" & payrate) .Add("Hours worked: " & hours) .Add("Grosspay: " & FormatCurrency(grosspay)) End With End Sub Sub paycheck(ByVal fullname As String, ByVal grosspay As Double) 'Output of paycheck LNam.Text = fullname Lamount.Text = (FormatCurrency(grosspay)) End Sub End Class