Help with EOF
Posted: Sat Dec 07, 2002 2:23 am
Hi Everyone, I am writing a simple payroll program that calculates the pay rate by the hours worked etc. I am having a problem with the EOF, it shows up on the output screen, also I need to calculate the total employees weekly pay, everything else is OK, I have tried so many different variables but I can't seem to get it, Here is my short program, If you can help me I appreciate your expertise!!!! Thanks
QB40 Program
QB40 Program
Code: Select all
'
'This program is designed to calculate a payroll report
'weekly pay is calculated by multiplying the hourly rate
'by hours worked. The wrap up module has the total number
'of employees and the total pay of the employees.
'
'Variables: Employee.name$= Name of Employee
' hours.worked=hours worked
' hourly.rate= hourly rate
' weekly.pay= weekly pay
' total.weekly.pay=weekly pay plus weekly pay
'
'
'
'
'
'
'**************************************************************************
'*************************Intialization**********************************
CLS 'Clear screen
LET Total.employees = 0
LET total.weekly.pay = 0
PRINT TAB(30); "Payroll Report"
PRINT
PRINT "Employee", "Hourly", "Hours", "Weekly"
PRINT "Name", "Rate", "Worked", "Pay"
PRINT
d1$ = "\ \##.## ##,### #,###.##"
t1$ = "Total employees=======>; ###"
T2$ = "Total Weekly Pay=====>; $$##,###.##"
T4$ = "End of Report"
'************************************Process File***********************
READ employee.name$, hourly.rate, hours.worked
DO UNTIL employee.name$ = "EOF"
LET total.employee = total.employee + 1
LET weekly.pay = hourly.rate * hours.worked
LET total.weekly.pay = weekly.pay + weekly.pay + weekly.pay + weekly.pay + weekly.pay
PRINT USING d1$; employee.name$; hourly.rate; hours.worked; weekly.pay
READ employee.name$, hourly.rate, hours.worked
LOOP
'********************wrap up********************** *******************
PRINT
PRINT USING d1$; employee.name$; hourly.rate; hours.worked; weekly.pay
PRINT USING t1$; total.employee
PRINT USING T2$; total.weekly.pay
PRINT
PRINT "End of Report"
'**********************Data Follows*****************************
DATA Joe Lomax, 7.70, 40
DATA Ed Mann, 6.05, 38.5
DATA Louis Orr, 8.10, 45
DATA Ted Simms, 9.5, 39.5
DATA Joan Zang, 12.0, 92
DATA EOF,0,0
end