Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0020/makebu.tuk
There are 2 other files named makebu.tuk in the archive. Click here to see a list.
10' NAME--MAKE-BUY
20'
30' DESCRIPTION--MAKE OR BUY DECISION
40'
50' SOURCE--UNKNOWN
60'
70' INSTRUCTIONS--INPUT THE NAME OF THE COMPONENT UNDER CONSIDERATION
71' (FIRST QUESTION) IN THE SINGULAR (NOT THE PLURAL).
80' 
90' THIS PROGRAM WAS WRITTEN FOR STUDENT USE AT AMOS TUCK SCHOOL
91' OF HANOVER, N.H. WHICH DOES NOT ASSUME RESPONSIBILITY FOR
92' ITS ACCURACY.
100'
110' * * * * * * * * * MAIN PROGRAM * * * * * * * * * * * * *
120'
400' INITIALIZATION
405 LET Y1=0  ' UPPER LIMIT PLOT ROUTINE
406 DEF FNP(C,X) ' LINE UP DECIMAL AND TRUNCATE TO 2 PLACES
410 LET X=(INT((X*100)+.5))/(100)
411 LET FNP=C-2
412 IF ABS(X)<1 THEN 414
413 LET FNP=FNP-INT((LOG(ABS(X))+5E-7)/LOG(10))
414 PRINT TAB(FNP);
415 LET FNP=X
416 FNEND
420 DIM A(25)
421 DIM B(25)
422 DIM C(25)
424 DIM D(25)
430 LET C2=0
431 LET C8=0
450 ' I.D. ROUTINE ***************************************************:
451 PRINT " "
455 PRINT
457 PRINT
500 ' LINES 500-700 ARE THE INPUT ROUTINE ******************************:
510 PRINT " THIS PROGRAM CALCULATES THE PRESENT VALUE OF THE COST ";
511 PRINT "SAVING INCURRED BY MAKING A PRODUCT AS OPPOSED TO BUYING ";
512 PRINT "IT."
515 PRINT
516 PRINT "FIRST I WOULD LIKE TO ASK YOU A FEW QUESTIONS..."
517 PRINT
518 PRINT
519 PRINT " WHAT IS THE NAME OF YOUR COMPANY";
521 PRINT
522 PRINT " WHAT IS THE NAME OF THE COMPONENT YOU ARE CONSIDERING"
523 PRINT "MAKING OR BUYING";
524 INPUT I$
525 PRINT
526 PRINT "*** ENTER ALL COSTS IN DOLLARS ***"
527 PRINT
530 PRINT "  1. WHAT IS THE COST TO BUY A ";I$;" FOB"
531 PRINT "YOUR PLANT";
533 INPUT I1
539 PRINT
540 PRINT "  2. WHAT IS THE COST TO MANUFACTURE A ";I$;" IN YOUR PLANT ";
541 PRINT "INCLUDING DIRECT MATERIALS AND LABOR BUT NOT OVERHEAD";
543 INPUT I2
549 PRINT
550 PRINT "  3. WHAT IS THE INITIAL INVESTMENT (COST OF THE EXTRA ";
551 PRINT "MACHINERY THAT WOULD BE NEEDED IF YOU WERE GOING TO"
552 PRINT "MANUFACTURE ";I$;"S)";
553 INPUT I3
559 PRINT
560 PRINT "  4. WHAT IS THE LIFE OF THE INVESTMENT IN YEARS";
563 INPUT I4
565 GO SUB 5000 ' INVESTMENT TAX CREDIT
569 PRINT
570 PRINT "  5. WHAT IS THE SALVAGE VALUE OF THIS INVESTMENT";
573 INPUT I5
574 LET C(I4)=-I5
579 PRINT
580 PRINT "  6. SUM-OF-THE-YEARS-DIGITS METHOD WILL BE USED TO ";
581 PRINT "DEPRECIATE THE INVESTMENT."
583 LET S4=0  ' SUM OF YEARS DIGITS ROUTINE
584 FOR S5=1 TO I4
585 LET S4=S4+S5
586 NEXT S5
589 PRINT
590 PRINT "  7. WHAT ARE THE ANNUAL FIXED COSTS (SUCH AS SUPERVISION ";
591 PRINT "AND MAINTENANCE) INVOLVED IN YOUR MAKING ";
592 PRINT I$;"S";
593 INPUT I7
599 PRINT
600 PRINT "  8. WHAT IS YOUR CORPORATE TAX RATE IN PERCENT";
603 INPUT I8
604 LET S1=I8
605 GO SUB 650
606 IF S2=1 THEN 600
607 LET I8=I8/100
609 PRINT
610 PRINT "  9. WHAT IS THE LOCAL TAX RATE ON THE EXTRA "
611 PRINT "INVESTMENT IN DOLLARS PER THOUSAND";
613 INPUT I9
614 LET I9=I9/1000
619 PRINT
620 PRINT "  10 WHAT IS YOUR COST OF CAPITAL IN PERCENT";
623 INPUT J1
624 LET S1=J1
625 GO SUB 650
626 IF S2=1 THEN 620
627 LET J1=J1/100
629 PRINT
630 PRINT "  11 WHAT IS YOUR ESTIMATE OF THE YEARLY DEMAND FOR ";I$;"S";
633 INPUT J2
649 GO TO 700
650 ' PERCENTAGE CHECK SUBROUTINE ************************************
653 IF S1>1 THEN 659
654 IF S1=0 THEN 659
655 PRINT "PLEASE GIVE YOUR ANSWER IN PERCENT."
657 LET S2=1
658 GO TO 660
659 LET S2=2
660 RETURN
700 'CONTINUE
703 LET D(0)=C7=D1
706 LET D(I4)=-I5*(1-I8)
710 FOR A=1 TO (I4-1)
711 LET C(A)=D(A)=0
712 NEXT A
1000 ' EXECUTIVE ROUTINE
1010 FOR A = 1 TO I4  ' TIME LOOP
1015 LET C6=(1+J1)^(A)  ' INTEREST FACTOR
1020 LET A(A)=I1*J2 'COST TO BUY
1030 LET B(A)=A(A)*(1-I8)  'DITTO - POST TAX
1033 LET C5=B(A)/C6
1036 LET C8=C8+C5 ' SUM OF PRESENT VALUE
1040 GO SUB 5200 ' DEPRECIATION
1050 LET C3=(I3-C2)*I9  ' STATE TAX
1060 LET C4=(I2*J2)+I7+C3 ' YEARLY MFG COST
1070 LET C(A)=C4+C1+C(A)
1080 LET D(A)=(C4*(1-I8))-(C1*I8)+D(A)
1090 LET C5=D(A)/C6  ' PRESENT VLAUE MFG.
1100 LET C7=C7+C5  ' SUM OF PV MFG
1200 NEXT A
1201 ' PRINT OUT ROUTINE
1203 PRINT
1205 PRINT "**********************************************************"
1207 PRINT
1210 PRINT "THE PRESENT VALUE OF THE COST TO MAKE IS ";C7
1220 PRINT "THE PRESENT VALUE OF THE COST TO BUY IS  ";C8
1230 PRINT
1235 LET C9=ABS(C8-C7)
1240 ON SGN(C8-C7)+2 GO TO 1250,1290,1270
1250 LET C$="BUY"
1260 GO TO 1280
1270 LET C$="MAKE"
1280 PRINT D$;" SHOULD ";C$;" ";I$;
1281 PRINT "S AT A SAVINGS OF ";C9;" DOLLARS."
1288 PRINT
1289 PRINT
1290 IF A1=1 THEN 2100
1291 PRINT " **** THE FLOWS ****"
1294 PRINT
1295 PRINT TAB(10);"IF BUY**********";
1300 PRINT TAB(38);"IF MAKE*********";
1310 PRINT TAB(62);"***NET***"
1320 PRINT "YEAR";
1330 PRINT TAB(8);"EXPENSE";
1340 PRINT TAB(20);"CASH FLOW";
1350 PRINT TAB(36);"EXPENSE";
1360 PRINT TAB (48);"CASH FLOW";
1370 PRINT TAB(62);"CASH FLOW"
1400 FOR A=0 TO I4
1410 PRINT A;FNP(12,A(A));
1420 PRINT FNP(24,B(A));
1430 PRINT FNP(40,C(A));
1440 PRINT FNP(52,D(A));
1450 LET S7=B(A)-D(A)
1460 PRINT FNP(66,S7)
1480 NEXT A
2000 ' SENSITIVITY CHECK
2001 PRINT
2002 PRINT "--------------------------------------------------------------"
2003 PRINT
2010 PRINT "WOULD YOU LIKE TO SEE THE EFFECT OF CHANGING "
2011 PRINT " A VARIABLE ( YES OR NO)";
2020 INPUT A$
2030 IF A$="NO" THEN 99999
2040 LET A1=1  ' FLAG
2050 PRINT "WHAT IS THE NUMBER OF THE QUESTION TO WHICH YOU "
2051 PRINT " WOULD LIKE TO CHANGE YOUR ANSWER";
2060 INPUT A2
2070 PRINT "WHAT IS THE NEW VALUE";
2080 INPUT A3
2090 GO TO 2180
2100 PRINT "MORE CHANGES";
2110 INPUT A$
2120 IF A$="NO" THEN 99999
2130 PRINT "SAME QUESTION";
2140 INPUT A2$
2150 IF A2$="NO" THEN 2050
2160 PRINT "NEW VALUE";
2170 INPUT A3
2180 ONA2GOTO2190,2200,2210,2220,2230,2240,2250,2260,2270,2280,2290
2190 LET I1=A3
2195 GO TO 2300
2200 LET I2=A3
2205 GO TO 2300
2210 LET I3=A3
2215 GO TO 2300
2220 LET I4=A3
2221 GO SUB 5000
2222 LET C(0)=I3
2224 LET S4=0 ' SUM OF DIDITS
2225 FOR S5=1 TO I4
2226 LET S4=S4+S5
2227 NEXT S5
2230 LET I5=A3
2231 LET C(I4)=-I5
2235 GO TO 2300
2240 LET I6=A3
2245 GO TO 2300
2250 LET I7=A3
2255 GO TO 2300
2260 LET I8=A3/100
2265 GO TO 2300
2270 LET I9=A3/1000
2275 GO TO 2300
2280 LET J1=A3/100
2285 GO TO 2300
2290 LET J2=A3
2300 LET C2=C8=0
4949 STOP
4950 ' SUB ROUTINE INDEX
4955 ' 5000-5130 INCESTMENT TAX CREDIT
4960 '5200-5230 DEPRECIATION
5000 ' INVESTMENT TAX CREDIT
5020 IF I4>=4 THEN 5050
5030 LET S3=0
5040 GO TO 5120
5050 IF I4>=6 THEN 5080
5060 PRINT R$;R$;R$;R$
5070 GO TO 5120
5080 IF I4>=8 THEN 5110
5090 LET S3=(2/3)*.07*I3
5100 GO TO 5120
5110 LET S3=.07*I3
5120 LET D1=I3-S3
5130 RETURN
5200 ' DEPRECIATION SUB-ROUTINE
5210 LET S6=I3-I5 ' DEPRECIABLE INVESTMENT
5220 LET C1=S6*((I4+1-A)/S4)'AMT OF DEPR.
5230 LET C2=C2+C1 ' ACCUNILATE DEPR.
5240 RETURN
6000 ' RUB-OUT SUBROUTINE -
6010 FOR I=1 TO 9
6020 READ R(I)
6030 NEXT I
6040 DATA 9,127,127,127,127,127,127,127,127,127
6050 CHANGER TO R$
99999 END