|
-
Mar 27th, 2000, 03:13 AM
#1
Thread Starter
Member
I cannot see why my total doesn't figure correctly.
Option Explicit
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdOutput_Click()
Dim empName As String, hrRate As String, hrWork As Single, _
grPay As String, totPay As String, fmt As String, i As Single, _
tpay As String
'display payroll report
picOutput.Cls
picOutput.Print "Payroll Report for Week ending 4/15/99"
picOutput.Print ""
picOutput.Print "Employee"; Tab(15); "Hourly Rate"; Tab(30);
picOutput.Print "Hours worked"; Tab(45); "Gross Pay"
fmt = "@@@@@@@@@@"
Open App.Path & "\Payroll.txt" For Input As #1
totPay = 0
grPay = 0
For i = 1 To 10
Input #1, empName, hrRate, hrWork
If hrWork <= 40 Then
grPay = hrWork * hrRate
ElseIf hrWork > 40 Then
grPay = (40 * hrRate) + (hrWork - 40) * (hrRate * 1.5)
End If
tpay = (grPay + totPay)
hrRate = FormatCurrency(hrRate)
grPay = FormatCurrency(grPay)
picOutput.Print empName; Tab(15); Format(hrRate, fmt); Tab(29);
picOutput.Print hrWork; Tab(42); Format(grPay, fmt)
Next i
Close #1
tpay = FormatCurrency(tpay)
picOutput.Print ""
picOutput.Print "Final Total"; Tab(15); Format(tpay, fmt)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|