Quote

This file is part of Synchro-Sette December 1982 . Download the collection to get this file.
Date: December 1982
Type: Program
Platform(s): TS 1000
Tags: Business

This program is a job cost estimator that calculates and prints a formatted quote for installation work, covering materials, shop labour, on-site labour, overhead, and profit. The user can choose to enter costs either as a single total or itemised line by line, with the itemisation routine (subroutine at line 1200) reused for materials, shop labour, and on-site labour. All monetary values are rounded to two decimal places using the classic INT(100*X+.05)/100 idiom before display. The quote summary is printed via a dedicated subroutine at line 3000, showing both per-unit and extended (total) figures in a tabulated layout using TAB stops.


Program Analysis

Program Structure

The program is organised into a main routine and three subroutines, with the main flow running from lines 10–690 and looping back to line 100 for repeated estimates. The global counter D (initialised at line 20, incremented at line 205) tracks the estimate number across sessions.

Line RangePurpose
10–20Initialisation: CLS, set estimate counter D=0
100–690Main loop: title display, user prompts, cost collection, quote display, loop back
1000–1190Subroutine: material cost entry (itemised or lump sum)
1200–1670Subroutine: generic itemised cost entry, accumulating into C
2000–2550Subroutine: shop and on-site labour entry (itemised or lump sum)
3000–3270Subroutine: formatted quote printout
9998–9999SAVE with auto-run flag, then RUN

Itemised Entry Subroutine (Lines 1200–1670)

The subroutine at line 1200 is a reusable itemised cost collector. It loops, prompting for item name, unit cost, and quantity, computing the extended cost (E = A * G), and accumulating the running total in C. Entry of a blank item name (B$="" at line 1255) terminates the loop. The result is returned in C, which the calling code then assigns to the appropriate variable (M, L, or H). This reuse of a single subroutine for three different cost categories is the most structurally notable aspect of the program.

There is a variable name collision hazard: C is used both as the overhead percentage (entered at line 410 and used in the formula at line 430) and as the accumulator inside the itemised entry subroutine (line 1200). After an itemised entry call, C is immediately copied to the target variable (lines 1155, 2120), but the overhead percentage previously stored in C is overwritten if itemisation is called after line 410 — however, in the actual execution order, overhead is collected after all labour and material subroutines have returned, so in practice this does not corrupt the overhead value during normal flow. The overhead percentage value in C is still correctly used at line 3200 for display.

Cost Calculation (Lines 550–640)

The quote calculations at lines 550–640 derive all figures from the per-unit costs and the installation count Q:

  • B = Q * M — total materials
  • K = Q * L — total shop labour
  • J = H * Q — total on-site labour
  • V = O * (L + H) — overhead per unit (percentage of direct labour)
  • W = V * Q — total overhead
  • R = P * (B + K + J + W) — total profit
  • X = R / Q — profit per unit
  • S = B + K + J + R + W — total job quote
  • T = S / Q — quote per unit

Rounding Technique

Monetary values are rounded to two decimal places just before display using the standard fixed-point idiom INT(100*X+.05)/100. This appears both in the itemised entry loop (line 1455) and throughout the summary subroutine (lines 3102–3256). The +.05 bias provides conventional rounding (round half up) rather than truncation.

SCROLL-Based Display

The program uses SCROLL extensively to control screen layout rather than CLS, producing a continuous paper-tape style output. Multiple consecutive SCROLL calls are used to create blank-line spacing between sections. CLS is reserved for major section transitions (title screen, start of quote entry, itemised cost screens).

Input Validation

Yes/No prompts are validated by checking the first character of the input string (e.g. B$(1)="Y"). If neither “Y” nor “N” is matched, execution falls through to a GOTO back to the INPUT line, forming a simple validation loop. This pattern appears at lines 1050–1070, 2040–2060, 2290–2310.

Notable Anomalies

  • Line 1155 assigns M=C after the itemised material subroutine, but note that the subroutine itself uses C as its accumulator, overwriting the overhead percentage if overhead were collected before this point. In the actual execution order this is safe, but the reuse of C for two distinct purposes is fragile.
  • The spelling “INSTALATIONS” (one ‘l’) at line 3080 is a typo in the output text.
  • Line 2130 uses GOTO 2240 to skip the lump-sum shop labour input block, jumping directly to the on-site labour section — a straightforward forward jump with no structural issue.
  • The INPUT Y$ at line 220 and line 530 simply waits for Enter; the content of Y$ is discarded, making these effectively “press Enter to continue” pauses.

Content

Appears On

Cassette to accompany the December 1982 issue of Synchro-Sette.

Related Products

Related Articles

Related Content

Image Gallery

Quote

Source Code

  10 CLS 
  20 LET D=0
 100 CLS 
 110 PRINT AT 12,0;" %*%*%*% %J%O%B% %Q%U%O%T%E% %E%S%T%I%M%A%T%E%R% %*%*%*"
 200 SCROLL 
 205 LET D=D+1
 210 PRINT "   PRESS ENTER TO START :::"
 220 INPUT Y$
 230 CLS 
 240 SCROLL 
 250 PRINT "JOB NAME?  ";
 260 INPUT N$
 270 PRINT N$
 280 SCROLL 
 290 SCROLL 
 300 PRINT "NUMBER OF INSTALLATIONS?"
 310 SCROLL 
 320 INPUT Q
 330 PRINT ,Q
 340 SCROLL 
 350 SCROLL 
 360 GOSUB 1000
 370 GOSUB 2000
 380 SCROLL 
 390 PRINT "OVERHEAD (PER. OF DIRECT LABOR)?"
 400 SCROLL 
 410 INPUT C
 420 SCROLL 
 425 PRINT ,C
 426 SCROLL 
 430 LET O=C/100
 440 SCROLL 
 450 PRINT "PROFIT (PER OF JOB COST)?"
 460 SCROLL 
 470 INPUT Z
 480 PRINT ,Z
 490 SCROLL 
 500 SCROLL 
 510 LET P=Z/100
 520 PRINT "PRESS ENTER TO SEE QUOTE :::"
 530 INPUT Y$
 540 CLS 
 550 LET B=Q*M
 560 LET K=Q*L
 570 LET J=H*Q
 590 LET V=O*(L+H)
 600 LET W=V*Q
 610 LET R=P*(B+K+J+W)
 620 LET X=R/Q
 630 LET S=B+K+J+R+W
 640 LET T=S/Q
 650 GOSUB 3000
 660 SCROLL 
 665 SCROLL 
 670 PRINT "PRESS ENTER FOR ANOTHER QUOTE ::"
 680 INPUT Y$
 690 GOTO 100
\n1000 PRINT "ARE MATERIAL COSTS TO BE"
\n1010 SCROLL 
\n1020 PRINT "ITEMIZED (Y/N)?"
\n1030 SCROLL 
\n1040 INPUT B$
\n1050 IF B$(1)="Y" THEN GOTO 1100
\n1060 IF B$(1)="N" THEN GOTO 1160
\n1070 GOTO 1040
\n1100 SCROLL 
\n1110 SCROLL 
\n1120 PRINT "MATERIAL COSTS :::"
\n1130 SCROLL 
\n1140 SCROLL 
\n1150 GOSUB 1200
\n1155 LET M=C
\n1156 RETURN 
\n1160 SCROLL 
\n1170 SCROLL 
\n1180 PRINT "TOTAL MATERIAL COST?  ";
\n1184 INPUT M
\n1186 PRINT M
\n1188 SCROLL 
\n1190 RETURN 
\n1200 LET C=0
\n1205 SCROLL 
\n1210 PRINT "ESTIMATE NO.";D
\n1220 SCROLL 
\n1230 SCROLL 
\n1240 PRINT "ITEM?",
\n1250 INPUT B$
\n1255 IF B$="" THEN GOTO 1600
\n1260 PRINT B$
\n1270 SCROLL 
\n1280 SCROLL 
\n1290 PRINT "COST?",
\n1300 INPUT A
\n1310 PRINT A
\n1320 SCROLL 
\n1340 SCROLL 
\n1350 PRINT "QUANTITY?",
\n1360 INPUT G
\n1370 PRINT G
\n1380 LET E=A*G
\n1390 SCROLL 
\n1400 SCROLL 
\n1410 SCROLL 
\n1430 PRINT "ITEM    COST    QUANT   EXTEND"
\n1440 SCROLL 
\n1450 SCROLL 
\n1455 LET E=INT (100*E+.05)/100
\n1460 PRINT B$;TAB 8;A;TAB 16;G;TAB 24;E
\n1470 SCROLL 
\n1480 SCROLL 
\n1490 LET C=C+E
\n1500 GOTO 1220
\n1600 SCROLL 
\n1605 SCROLL 
\n1610 PRINT "TOTAL",C
\n1620 SCROLL 
\n1630 SCROLL 
\n1640 PRINT "PRESS ENTER TO CONTINUE :::"
\n1650 INPUT B$
\n1660 CLS 
\n1670 RETURN 
\n2000 SCROLL 
\n2010 SCROLL 
\n2020 PRINT "DO YOU WANT SHOP LABOR ITEMIZED?"
\n2030 INPUT Y$
\n2040 IF Y$(1)="N" THEN GOTO 2140
\n2050 IF Y$(1)="Y" THEN GOTO 2070
\n2060 GOTO 2030
\n2070 SCROLL 
\n2080 SCROLL 
\n2090 PRINT "SHOP LABOR PER HOUR"
\n2100 SCROLL 
\n2110 SCROLL 
\n2115 GOSUB 1200
\n2120 LET L=C
\n2130 GOTO 2240
\n2140 SCROLL 
\n2150 SCROLL 
\n2160 PRINT "COST FOR TOTAL SHOP LABOR?"
\n2170 SCROLL 
\n2180 SCROLL 
\n2190 INPUT L
\n2200 PRINT ,L
\n2210 SCROLL 
\n2240 SCROLL 
\n2260 PRINT "ON SITE LABOR TO BE ITEMIZED?"
\n2270 SCROLL 
\n2280 INPUT B$
\n2290 IF B$(1)="Y" THEN GOTO 2320
\n2300 IF B$(1)="N" THEN GOTO 2500
\n2310 GOTO 2280
\n2320 CLS 
\n2330 PRINT ,,"ON SITE LABOR PER HOUR :::"
\n2340 GOSUB 1200
\n2350 LET H=C
\n2360 RETURN 
\n2500 SCROLL 
\n2510 SCROLL 
\n2520 PRINT "ON SITE LABOR TOTAL COST?"
\n2530 INPUT H
\n2540 SCROLL 
\n2550 RETURN 
\n3000 SCROLL 
\n3010 SCROLL 
\n3020 PRINT "NAME   ";N$;TAB 16;"ESTIMATE ";D
\n3030 SCROLL 
\n3040 SCROLL 
\n3050 PRINT "EST PAR    NO. UNITS    EXTENDED"
\n3060 SCROLL 
\n3070 SCROLL 
\n3080 PRINT "NUMBER OF INSTALATIONS   ";Q
\n3090 SCROLL 
\n3100 SCROLL 
\n3102 LET M=INT (100*M+.05)/100
\n3104 LET B=INT (100*B+.05)/100
\n3110 PRINT "MATERIAL COST ";M;TAB 25;B
\n3120 SCROLL 
\n3130 SCROLL 
\n3132 LET L=INT (100*L+.05)/100
\n3134 LET K=INT (100*K+.05)/100
\n3140 PRINT "SHOP LAB COST ";L;TAB 25;K
\n3150 SCROLL 
\n3160 SCROLL 
\n3162 LET H=INT (100*H+.05)/100
\n3164 LET J=INT (100*J+.05)/100
\n3170 PRINT "SITE LAB COST ";H;TAB 25;J
\n3180 SCROLL 
\n3190 SCROLL 
\n3195 LET W=INT (100*W+.05)/100
\n3196 LET V=INT (100*V+.05)/100
\n3200 PRINT "OVRHD";" (";C;")";TAB 14;V;TAB 25;W
\n3210 SCROLL 
\n3220 SCROLL 
\n3225 LET R=INT (100*R+.05)/100
\n3226 LET X=INT (100*X+.05)/100
\n3230 PRINT "PROFIT";" (";Z;")";TAB 14;X;TAB 25;R
\n3240 SCROLL 
\n3250 SCROLL 
\n3255 LET S=INT (100*S+.05)/100
\n3256 LET T=INT (100*T+.05)/100
\n3260 PRINT "JOB QUOTE";TAB 14;T;TAB 25;S
\n3270 RETURN 
\n9998 SAVE "QUOT%E"
\n9999 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top