[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2018-10-06T15:52:14-05:00 http://petesqbsite.com/phpBB3/app.php/feed/topic/8287 2018-10-06T15:52:14-05:00 2018-10-06T15:52:14-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=31195#p31195 <![CDATA[Re: Qbasic Program wont run]]> Statistics: Posted by MikeHawk — Sat Oct 06, 2018 3:52 pm


]]>
2018-10-02T09:59:27-05:00 2018-10-02T09:59:27-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=31191#p31191 <![CDATA[Qbasic Program wont run]]>
Rem Richard Kopycinski
'***************************** Piecework Workers ****************************
'
CLS
GOSUB InitalizeImage
GOSUB PrintHeading
GOSUB ProcessDetail
GOSUB PrintTotal
END
'***************************** Initalize Image ******************************
InitalizeImage:
T1$ = " PIECEWORK WEEKLY REPORT "
H1$ = " NAME PIECES PAY "
D1$ = " / / ### ###.## "
TL$ = "TOTALS: #,### #,###.## "
RETURN
'****************************** Print Heading *******************************
PrintHeading:
PRINT
PRINT T1$ 'Print Title Line
PRINT
PRINT H1$ 'Heading Line
PRINT
PRINT
RETURN
'****************************** Process Detail ******************************
'
CLS
ProcessDetail:
GOSUB ReadData
DO UNTIL Name$ = "Last Record"
GOSUB CalculateAnswer
GOSUB PrintDetail
GOSUB ReadData
LOOP
RETURN
'
'******************************* Read Data **********************************
ReadData:
READ Name$, Pieces
DATA JOHNNY BEGOOD, 265
DATA SALLY GREAT, 650
DATA SAM KLUTZ, 177
DATA PETE PRECISE, 400
DATA FANNIE FANTASTIC, 399
DATA MORRIE MELLOW, 200
DATA "Last Record", 0
RETURN
'
'****************************** Calculate Answer ****************************
CalculateAnswer:
IF Pieces >= 1 AND Pieces <= 199 THEN
Rate = 0.50
ELSEIF Pieces >= 200 AND Pieces <=399 THEN
Rate = 0.55
ELSEIF Pieces >= 400 AND Pieces <=599 THEN
Rate = 0.60
ELSEIF Pieces >= 600 THEN
Rate = 0.65
ELSE RATE = 0
END IF
Pay = (PIECES * Rate)
TotPieces = (TotPieces + PIECES)
TotPay = (TotPay + Pay)
RETURN
'******************************* Print Detail *******************************
Print Detail:
PRINT USING D1$; Name$, Pieces, Pay
RETURN
'******************************* Print Total ********************************
PrintTotal:
PRINT
PRINT USING TL$; TotPieces, TotPay
PRINT
RETURN
'****************************** END OF PROGRAM *******************************

Statistics: Posted by RichK88 — Tue Oct 02, 2018 9:59 am


]]>