.J NEW 10 *NAME DECIDE 20 DIMF$(10),L$(10),F(10),M(10,10),V(10),Z(10),Z$(1) 30 CLS 40 PROC_BOLD:PRINT " Z88 DECISION MAKER":PROC_BOLD 50 PRINT 60 PRINT"Which best describes the type of decision you have to make:" 80 PRINT" (1) Choose an item" 90 PRINT" (2) Choose a course of action" 100 INPUT"Which type (1 or 2)";C 110 IFC<1ORC>2THEN PROC_BOLD:PRINT"Invalid Choice.":PROC_BOLD:GOTO100 120 IFC=1THENPRINT" What type of item is it that you" 130 IFC=1THENINPUT" need to decide upon";S$ 140 IFC=2THENS$="Action" 150 PRINT"Now list each ";S$;" being considered, one at a time." 170 PRINT"The order is not important." 180 INPUT" First, how many are there ";L0 190 IFL0>=2ANDL0<=10THEN210 200 GOSUB790:GOTO180 210 FORI=1TOL0:PRINT"Number ";I;" please"; 220 INPUTL$(I):NEXTI 240 FORI=1TOL0:PRINTI;TAB(15);L$(I):NEXTI:GOSUB800 250 IFLEFT$(B$,1)<>"Y"ANDLEFT$(B$,1)<>"y"THEN150 260 PRINT:PRINT"How many factors are important in choosing a ";S$;:INPUTF0 280 IFF0>=1ANDF0<=10THEN300 290 GOSUB790:GOTO260 300 PRINT"I need a list of each of these factors." 310 FORI=1TOF0:PRINT" Factor number ";I;:INPUTF$(I):NEXTI 320 GOSUB900:PRINT"Now decide which is the most important:" 340 FORI=1TOF0:PRINTI;TAB(15);F$(I):NEXTI 350 PRINT"Which factor (by no.) is most important?" 360 INPUT" (Input 0 to change the list) ";F2:PRINT 370 IF F2=0 THEN 260 380 IF F2<1 OR F2>F0 THEN 350 390 PRINT"Suppose a scale of importance from 0 to 10." 400 PRINT"Say ";F$(F2);" has a value of 10 since it is at the top." 420 PRINT"What value would each of the others" 430 PRINT"have (decimal numbers are O.K.)?":FOR I=1 TO F0 440 IF I=F2 THEN 470 450 PRINT" ";F$(I);:INPUTF(I):IF F(I)>=0 AND F(I)<=10 THEN 470 460 PRINT" Your input is no good, try again.":GOTO450 470 NEXTI:F(F2)=10:C=0:FORI=1TOF0:C=C+F(I):NEXTI:FORI=1TOF0 480 F(I)=F(I)/C:NEXTI:PRINT 485 PRINT"Now consider how each ";S$;" rates for each of the factors." 500 PRINT"Consider each factor alone & rate each in terms of that factor only." 520 PRINT"Let's consider ";L$(1);" to have a value of 10 on each scale." 535 PRINT"Then every other ";S$;" will be given a number higher or lower than 10" 550 PRINT"according to how much better or worse than ";L$(1);" you think it is." 560 GOSUB900:FORI=1TOF0:PRINT 570 PRINT"Considering ";F$(I);" only, and assuming ";L$(1);" to be 10," 590 PRINT"what value would you give to each of the following:" 595 M(1,I)=10 600 FOR J=2 TO L0 610 PRINT " ";L$(J);:INPUTM(J,I):IF M(J,I)>=0 THEN 640 620 PRINT"No negative numbers. Try again.":GOTO610 640 C=C+M(J,I):NEXTJ:FORJ=1TOL0:M(J,I)=M(J,I)/C:NEXTJ:NEXTI 650 FORJ=1TOL0:V(J)=0:FORI=1TOF0:V(J)=V(J)+M(J,I)*F(I) 660 NEXTI:NEXTJ:FORI=1TO10:Z(I)=I:NEXTI:C=L0-1:FORJ=1TOL0 670 FORI=1TOC:N1=Z(I):N2=Z(I+1):IFV(N1)>V(N2)THEN690 680 Z(I+1)=N1:Z(I)=N2 690 NEXTI:NEXTJ:C1=Z(1):C2=Z(2):C=100/V(C1):FORJ=1TOL0 700 V(J)=C*V(J):NEXTJ:PRINT:D=V(C1)-V(C2) 705 PROC_BOLD 710 PRINT" Your best choice is ";L$(C1) 715 PROC_BOLD 720 IF D<10 THEN PRINT" but it's pretty close." 730 IF D<20 AND D>=10 THEN PRINT" by a fair margin." 740 IF D>=20 THEN PRINT" by a good-sized margin." 750 PRINT"Here's the final list with ";L$(C1) 760 PRINT"given a value of 100 and the others set accordingly.":GOSUB900 770 PRINT" ";CHR$(1);"U";S$," Rating",CHR$(1);"U" 780 FORJ=1TOL0:C=Z(J):PRINT" ";L$(C),.1*INT(10*V(C)+.5):NEXTJ:GOTO810 790 PRINT"The number must be between 2 and 10.":RETURN 800 INPUT"Is this correct";B$:RETURN 810 INPUT"Do you have another case";A$ 820 IF LEFT$(A$,1)<>"N" AND LEFT$(A$,1)<>"n" THEN RUN ELSE END 900 PROC_BOLD 920 PRINT" >>Press any key to continue<<" 930 PROC_BOLD 950 Z$=GET$:RETURN 1000 DEFPROC_BOLD 1010 PRINT CHR$(1);"B"; 1020 ENDPROC