records = 4 OPTION BASE 0 DIM name$(records) DIM hours(records) DIM rate(records) DIM pay(records) crlf$ = CHR$(10) + CHR$(13) header$ = "Name Hours Rate Pay" headr2$ = "---- ----- ---- ---" footer$ = " total:" DATA "Joe Snerd", 40, 5.65, 0 DATA "Sally May", 37, 4.25, 0 DATA "Don Ho", 45, 10.00, 0 DATA "Betty Buns", 41, 4.00, 0 start: CLS RESTORE GOSUB InitDataBase GOSUB CalcPay PRINT header$ PRINT headr2$ total = 0 FOR record = 0 TO records - 1 GOSUB PrintRecord total = total + pay(record) NEXT record PRINT : PRINT footer$; LOCATE , 38: PRINT USING "$$###.##"; total END PrintRecord: LOCATE , 1: PRINT name$(record); LOCATE , 23: PRINT USING "###"; hours(record); LOCATE , 29: PRINT USING "$$#.##"; rate(record); LOCATE , 38: PRINT USING "$$###.##"; pay(record) RETURN CalcPay: FOR record = 0 TO records - 1 RegularTime = rate(record) * hours(record) IF hours(record) > 40 THEN OverTime = (hours(record) - 40) * rate(record) * .5 ELSE OverTime = 0 END IF pay(record) = RegularTime + OverTime NEXT record RETURN InitDataBase: FOR record = 0 TO records - 1 READ name$(record) READ hours(record) READ rate(record) READ pay(record) NEXT record RETURN