Statistics: Posted by Jack002 — Wed Apr 03, 2019 2:34 pm
Code:
' ***** Program Mainline *****CLSGOSUB InitializeVariablesGOSUB PrintHeadingsGOSUB ProcessDetailGOSUB PrintTotalsEND' ***** Initialize Variables *****InitializeVariables:T1$ = " Model Car Collection"H1$ = " Manufacturer # Yr Make Model Description Price "D1$ = "\ ##\, ##, \ \, \ \, \ \, ##.## " TL$ = " Collection Total Value ####.##"RETURN' ***** Print Headings ***PrintHeadings:PRINTPRINT T1$PRINTPRINT H1$PRINTPRINTRETURN' ***** Process Detail ***ProcessDetail: GOSUB ReadDataDO UNTIL Nam$ = "END"GOSUB CalculateAnswer GOSUB PrintDetail GOSUB ReadDataLOOPReturn'' ***** Read Input Data ****ReadData:READ Nam$, Yr, Make, Model, Description, PriceData BMR--R79, 49, FIAT, 500B, GILLETTE RAZOR, 7.99Data HOTWELS--34, 57, CHEVY, NOMAD, 4//DR STATION WAGON, 12.95 Data MATCHBX--878, 73, FORD, BRONC, 3//DR 4X4 RED SPARE WHL, 25.99Data MATCHBX--72, 69, BUIK, CENTY, YELLOW TAXI, 1.49Data BRM--R88, 34, BUGAT, TY575, RACER BLACK, 35.00Data MATCHBX--25, 80, LINCO, MRKIV, WHITE LIMOUSINE, 14.99Data Lesney--Y42, 82, CHEVY, MALBU, 4//DR GREEN PASSENGER, 1.99Data HASBRO--119, 75, AMC, GRMLN, 2//DR SEDAN YELLOW, 1.69Data TABY--6332, 71, TOYOT, CELIC, 2//DR SEDAN BLUE, 2.99Data BMR--SY238, 36, ROLRY, SYLVC, 4//DR SEDAN SILVER--GRAY, 60.00Data "End", 0Return'' ***** Calculate Answer *****CalculateAnswer:Let Totalcollec = Totalcollec + PriceReturn' ***** Print Detail *****PrintDetail:PRINT USING D1$; Nam$, Yr, Make, Model, Description, PriceRETURN' ***** Print Totals *****PrintTotals:PRINTPRINT USING TL$; TotalcollecPRINTRETURN' ***** End of Program *****
Statistics: Posted by QBasicin2019 — Fri Mar 22, 2019 9:28 pm