10 REM   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
20 REM   * *                                                       * *
30 REM   * *      P R O J E C T   C O S T   C A L C U L A T O R    * *
40 REM   * *                                                       * *
50 REM   * *      H. HAWKINS                       OCTOBER 1983    * *
60 REM   * *                                                       * *
70 REM   * *                                                       * *
80 REM   * *            CONFIGURED FOR THE OSBORNE EXEC            * *
90 REM   * *                                                       * *
100 REM  * *                                                       * *
110 REM  * *                AND EPSON FX-80 PRINTER                * *
120 REM  * *                      			           * *
130 REM  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
140 REM
150 GOSUB 1230: REM     =========>    * * * * CLEARS THE SCREEN * * * *
160 REM
170 DIM A$(25): REM * * SET UP INPUT DATA ARRAY FOR 25 ITEMS * * * * *
180 REM
190 REM * * * * * * * * * * *  INPUT INFORMATION * * * * * * * * * * *
200 REM
210 INPUT "ENTER NUMBER OF PARTS ";Q
220 GOSUB 1230
230 FOR X=1 TO Q
240 PRINT"ENTER NAME OF PART NUMBER ";X;" (MAXIMUM 10 CHARACTERS.)"
250 INPUT Z$
260 IF LEN(Z$)<1 THEN 240
270 IF LEN(Z$)<10 THEN Z$=Z$+" ":GOTO 270: REM * * PACK STRING * *
280 IF LEN(Z$)>10 THEN GOSUB 1240:GOTO 240
290 GOSUB 1230
300 PRINT"ENTER NUMBER OF PIECES OF ";Z$
310 INPUT P$
320 IF LEN(P$)<>1 THEN 290
330 GOSUB 1230
340 INPUT "ENTER TYPE OF MATERIAL (MAXIMUM 10 SPACES): ";K$
350 IF LEN(K$)<1 THEN 330
360 IF LEN(K$)<10 THEN K$=K$+" ":GOTO 360: REM ** PACK STRING **
370 IF LEN(K$)>10 THEN GOSUB 1240:GOTO 330
380 GOSUB 1230
390 PRINT"ENTER DIMENSIONS OF ";Z$
400 INPUT "ENTER LENGTH IN INCHES (3 DIGITS MAXIMUM)  ";L$
410 IF LEN(L$)<1 THEN 400
420 IF LEN(L$)<3 THEN L$=L$+" ":GOTO 420
430 IF LEN(L$)>3 THEN GOSUB 1240:GOTO360
440 INPUT "ENTER WIDTH IN INCHES (3 DIGITS MAXIMUM) ";W$
450 IF LEN(W$)<1 THEN 440
460 IF LEN(W$)<3 THEN W$=W$+" ":GOTO 460: REM * * PACK STRING * *
470 IF LEN(W$)>3 THEN GOSUB 1240:GOTO 440
480 INPUT "ENTER THICKNESS IN WHOLE INCHES.";T$
490 IF LEN(T$)<>1 THEN 480
500 BF=VAL(L$)*VAL(W$)*VAL(T$): REM * * CALCULATE BOARD FEET  * *
510 REM
520 BF=((BF/144)*VAL(P$)):B$=STR$(BF): REM CALCULATE TOTAL BD. FT. *
530 REM
540 IF LEN(B$)<10 THEN B$=B$+" ":GOTO 540: REM ** PACK STRING **
550 GOSUB 1230
560 INPUT "ENTER UNIT COST OR COST PER BD.FT ";C$
570 GOSUB 1230
580 IF LEN(C$)<5 THEN C$=C$+" ":GOTO 580: REM * * PACK STRING * *
590 REM
600 TC=VAL(C$)*VAL(B$): REM * * * * * CALCULATE TOTAL COST * * * *
610 R$=STR$(TC): REM * * CONVERT TOTAL COST TO STRING FOR STORAGE * *
620 IF LEN(R$)<10 THEN R$=R$+" ":GOTO 620: REM * * PACK STRING * *
630 REM
640 A$(X)=Z$+P$+L$+W$+T$+C$+B$+R$+K$: REM * TOTAL DATA STRING (53 SPACES) *
650 NEXT X
660 TC=0:FC=0:REM  * * *  SET FINAL COST TO ZERO PRIOR TO PRINTING * * *
670 GOSUB 1230
680 REM * * * * * * * * * * P R I N T   T O T A L S * * * * * * * * * * * *
690 REM
700 INPUT "ENTER YOUR NAME :";N$
710 GOSUB 1230
720 PRINT"ENTER YOUR CLASS AND SECTION (SUCH AS I.A. LAB 120-55)."
730 LINE INPUT; S$
740 GOSUB 1230
750 PRINT"ENTER TODAY'S DATE :"
760 LINE INPUT; D$
770 GOSUB 1230
780 INPUT "ENTER H FOR <HARDCOPY> OR V FOR <VIDEO DISPLAY>";F$
790 IF F$="H" THEN 1270
800 GOSUB 1230
810 PRINT "                P R O J E C T   C O S T    S U M M A R Y"
820 PRINT
830 PRINT "    ";N$;"                              DATE : ";D$
840 PRINT
850 PRINT "============================================================================"
860 PRINT "PART NAME   MATERIAL    NO.PCS  L    W    T     BD.FT      UNIT   TOTAL COST"
870 PRINT "============================================================================" 
880 FOR Y=1 TO Q
890 Z$=LEFT$(A$(Y),10)
900 P$=MID$(A$(Y),11,1)
910 L$=MID$(A$(Y),12,3)
920 W$=MID$(A$(Y),15,3)
930 T$=MID$(A$(Y),18,1)
940 C$=MID$(A$(Y),19,5)
950 B$=MID$(A$(Y),24,10)
960 R$=MID$(A$(Y),34,10)
970 K$=RIGHT$(A$(Y),10)
980 B=VAL(B$)
990 C=VAL(C$)
1000 R=VAL(R$)
1010 PRINT Z$;"   ";K$;"    ";P$;"    ";L$;"  ";W$;"  ";T$;"     ";
1020 PRINT USING "##.#"; B;:PRINT "      ";
1030 PRINT USING "##.##";C;
1040 PRINT "     ";
1050 PRINT USING "##.##";R
1060 FC=FC+R:REM * * * TRACK FINAL COST OF PROJECT * * * 
1070 FB=FB+B:REM * * * TRACK FINAL BOARD FEET FOR PROJECT * * *
1080 NEXT Y
1090 PRINT
1100 PRINT "============================================================================"
1110 PRINT
1120 PRINT "                           TOTAL BOARD FEET =";
1130 PRINT USING "##.#";FB
1140 PRINT
1150 PRINT "                       25% ADD ON FOR WASTE = ";
1160 PRINT USING "$$##.##";.25*FC
1170 PRINT
1180 PRINT "                                 TOTAL COST = ";:PRINT USING "$$##.##";(FC+(.25*FC))
1190 PRINT"TO RUN THIS PROGRAM AGAIN TYPE <R>, TO END TYPE <E>. TO PRINT HARDCOPY, TYPE <H>"
1200 INPUT H$
1210 IF H$="H" THEN B=0:C=0:R=0:FB=0:FC=0:GOTO 1270 
1220 IF H$="R" THEN RUN ELSE 1680
1230 PRINT CHR$(26):RETURN: REM * * * CLEAR SCREEN SUB ROUTINE * * * 
1240 PRINT "YOU ENTERED TOO MANY CHARACTERS - TRY AGAIN"
1250 FOR P=1 TO 1000:NEXT
1260 RETURN
1270 REM * * * * * *  H A R D C O P Y  P R I N T O U T  R O U T I N E  * * *
1280 LPRINT CHR$(27);"!";CHR$(8):REM * * SETUP EPSON PRINTER EMPHASIZED TYPE * *
1290 LPRINT "                    P R O J E C T   C O S T   S U M M A R Y"
1300 LPRINT:LPRINT:LPRINT
1310 LPRINT "     ";N$;"                         DATE : ";D$
1320 LPRINT:LPRINT
1330 LPRINT "================================================================================"
1340 LPRINT "PART NAME   MATERIAL    NO.PCS  L     W    T    BD.FT      UNIT       TOTAL COST"
1350 LPRINT "================================================================================"
1360 FOR Y=1 TO Q
1370 Z$=LEFT$(A$(Y),10)
1380 P$=MID$(A$(Y),11,1)
1390 L$=MID$(A$(Y),12,3)
1400 W$=MID$(A$(Y),15,3)
1410 T$=MID$(A$(Y),18,1)
1420 C$=MID$(A$(Y),19,5)
1430 B$=MID$(A$(Y),24,10)
1440 R$=MID$(A$(Y),34,10)
1450 K$=RIGHT$(A$(Y),10)
1460  B=VAL(B$)
1470 C=VAL(C$)
1480 R=VAL(R$)
1490 LPRINT Z$;"   ";K$;"    ";P$;"    ";L$;"   ";W$;"  ";T$;"    ";
1500 LPRINT USING "##.#";B;:LPRINT "      ";
1510 LPRINT USING "##.##";C;
1520 LPRINT "          ";
1530 LPRINT USING "##.##";R
1540 FC=FC+R
1550 FB=FB+B
1560 NEXT Y
1570 LPRINT
1580 LPRINT "================================================================================"
1590 LPRINT
1600 LPRINT "                           TOTAL BOARD FEET =";
1610 LPRINT USING "##.##";FB
1620 LPRINT
1630 LPRINT "                       25% ADD ON FOR WASTE =";
1640 LPRINT USING "$$##.##";.25*FC
1650 LPRINT
1660 LPRINT "                                 TOTAL COST =";:LPRINT USING "$$##.##";(FC+(.25*FC))
1670 GOTO 1190
1680 END

1660 LPRINT "                                 TOTAL COST =";:LPRINT USING "$$##.##";(FC+(.25*FC))
