PR41 - CalculateTotals IF numpiec< 200 THEN LET pay =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 **** program for workers ***** Variables used Nam$ workers name Numpiec Number of pieces Payment Payment Pay payd amount *********** Program Mainline*********** CLS GOSUB initializeVariables GOSUB PrintHeadings GOSUB ProcessDetail GOSUB PrintSummary END *********** Initialize ******** initializeVariables: LET T1$ = " PIECEWORK WEEKLY REPORT" LET H1$ = " NAME PIECES PAY" LET D1$ = "\ \ ### #### " LET TL$ = " TOTALS #### #### " RETURN ******* PrintHeadings ****** PrintHeadings: PRINT PRINT T1$ 'Print title line PRINT PRINT H1$ 'Heading line PRINT PRINT RETURN *********** Process detail******** ProcessDetail: GOSUB InputWorker DO UNTIL UCASE$(Nam$) = "END" INPUT "ENTER NUMBER OF PIECES ", numpiec GOSUB CalculateTotals GOSUB PrintDetail GOSUB InputWorker LOOP RETURN *********** Calculate Totals *********
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CalculateTotals: IF numpiec < 200 THEN LET pay = numpiec * .5 END IF IF numpiec > 199 AND numpiec < 400 THEN Sheet1 Page 2 LET pay = numpiec * .55 END IF IF numpiec > 399 AND numpiec < 600 THEN LET pay = numpiec * .6 END IF IF numpiec > 599 THEN LET pay = numpiec * .65 END IF LET totpieces = totpieces + numpiec LET totpay = totpay + pay RETURN ************* Print detail *********** PrintDetail: PRINT USING D1$ Nam$ numpiec pay RETURN *********** Input Worker ********** InputWorker: INPUT "ENTER NAME OF WORKER (END to Quit):", Nam$ RETURN ****** Print Summary **** PrintSummary: PRINT PRINT T1$ PRINT PRINT H1$ PRINT PRINT USING D1$ Name$ numpiec pay PRINT PRINT PRINT USING TL$ totpieces totpay...
View Full Document

This note was uploaded on 04/30/2008 for the course CIS 130 taught by Professor Ram during the Spring '08 term at Joliet Junior College.

Page1 / 2

PR41 - CalculateTotals IF numpiec< 200 THEN LET pay =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online