Receiving Syntax error on homework (Code included)
Posted: Fri Mar 22, 2019 9:28 pm
Hey, I have a QB project due this sunday and I'm receiving a syntax error. I have a hunch that it's the numeric constants of (-,/) , but the given data for the project incorporates them. I would truly appreciate some wisdom on the subject.
This is the project question:
Write a program to create an inventory list for your collection of model cars using the top-down approach in planning, coding, and testing the program. Code the main module and the detail module, and create sub submodules for the initialization, title, headings, read, calculations, output, and totals.
The only total required is the total price of the collection.
This is the project question:
Write a program to create an inventory list for your collection of model cars using the top-down approach in planning, coding, and testing the program. Code the main module and the detail module, and create sub submodules for the initialization, title, headings, read, calculations, output, and totals.
The only total required is the total price of the collection.
Code: Select all
' ***** Program Mainline *****
CLS
GOSUB InitializeVariables
GOSUB PrintHeadings
GOSUB ProcessDetail
GOSUB PrintTotals
END
' ***** Initialize Variables *****
InitializeVariables:
T1$ = " Model Car Collection"
H1$ = " Manufacturer # Yr Make Model Description Price "
D1$ = "\ ##\, ##, \ \, \ \, \ \, ##.## "
TL$ = " Collection Total Value ####.##"
RETURN
' ***** Print Headings ***
PrintHeadings:
PRINT
PRINT T1$
PRINT
PRINT H1$
PRINT
PRINT
RETURN
' ***** Process Detail ***
ProcessDetail:
GOSUB ReadData
DO UNTIL Nam$ = "END"
GOSUB CalculateAnswer
GOSUB PrintDetail
GOSUB ReadData
LOOP
Return
'
' ***** Read Input Data ****
ReadData:
READ Nam$, Yr, Make, Model, Description, Price
Data BMR--R79, 49, FIAT, 500B, GILLETTE RAZOR, 7.99
Data HOTWELS--34, 57, CHEVY, NOMAD, 4//DR STATION WAGON, 12.95
Data MATCHBX--878, 73, FORD, BRONC, 3//DR 4X4 RED SPARE WHL, 25.99
Data MATCHBX--72, 69, BUIK, CENTY, YELLOW TAXI, 1.49
Data BRM--R88, 34, BUGAT, TY575, RACER BLACK, 35.00
Data MATCHBX--25, 80, LINCO, MRKIV, WHITE LIMOUSINE, 14.99
Data Lesney--Y42, 82, CHEVY, MALBU, 4//DR GREEN PASSENGER, 1.99
Data HASBRO--119, 75, AMC, GRMLN, 2//DR SEDAN YELLOW, 1.69
Data TABY--6332, 71, TOYOT, CELIC, 2//DR SEDAN BLUE, 2.99
Data BMR--SY238, 36, ROLRY, SYLVC, 4//DR SEDAN SILVER--GRAY, 60.00
Data "End", 0
Return
'
' ***** Calculate Answer *****
CalculateAnswer:
Let Totalcollec = Totalcollec + Price
Return
' ***** Print Detail *****
PrintDetail:
PRINT USING D1$; Nam$, Yr, Make, Model, Description, Price
RETURN
' ***** Print Totals *****
PrintTotals:
PRINT
PRINT USING TL$; Totalcollec
PRINT
RETURN
' ***** End of Program *****