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