home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / bus / decid2.ba < prev    next >
Text File  |  2006-10-19  |  4KB  |  91 lines

  1. 0 'DECIDE2.BA Phil Wheeler
  2. 1 'CLUB 100 Library - 415/939-1246 BBS,    937-5039 NEWSLETTER, 932-8856 VOICE
  3. 2 'This is a Decision-Making program
  4. 3 'adapted from an MBASIC version found
  5. 4 'on an RCP/M. It can be a game or a
  6. 5 'tool. It is not compact
  7. 10 CLEAR500
  8. 20 DIMF$(10),L$(10),F(10),M(10,10),V(10),Z(10),Z$(1)
  9. 30 RV$=CHR$(27)+"p":NO$=CHR$(27)+"q"
  10. 40 PRINTRV$+"                DECISION                "+NO$
  11. 60 PRINT"Which best describes the type of"
  12. 70 PRINT"decision you have to make:"
  13. 80 PRINT"(1) Choose an item"
  14. 90 PRINT"(2) Choose a course of action"
  15. 100 INPUT"Which type (1 or 2)";C
  16. 110 IFC<1ORC>2THENPRINT"ILLEGAL CHOICE.":GOTO100
  17. 120 PRINT:IFC=1THENPRINT"What type of item is it that you"
  18. 130 IFC=1THENINPUT"need to decide upon";S$
  19. 140 IFC=2THENS$="Action"
  20. 150 PRINT:PRINT"Now list each ";S$
  21. 160 PRINT"being considered,one at a time."
  22. 170 PRINT"The order is not important."
  23. 180 PRINT:INPUT"   First, how many are there ";L0
  24. 190 IFL0>=2ANDL0<=10THEN210
  25. 200 GOSUB790:GOTO180
  26. 210 PRINT:FORI=1TOL0:PRINT"Number";I;"please";
  27. 220 INPUTL$(I):NEXTI:PRINT
  28. 240 FORI=1TOL0:PRINTI;TAB(5);L$(I):NEXTI:PRINT:GOSUB800
  29. 250 IFLEFT$(B$,1)<>"Y"ANDLEFT$(B$,1)<>"y"THEN150
  30. 260 PRINT:PRINT"How many factors are important"
  31. 270 PRINT"in choosing a ";S$;:INPUTF0
  32. 280 IFF0>=1ANDF0<=10THEN300
  33. 290 GOSUB790:GOTO260
  34. 300 PRINT:PRINT"I need a list of each of these factors."
  35. 310 FORI=1TOF0:PRINT"Factor number";I;:INPUTF$(I):NEXTI
  36. 320 GOSUB900:PRINT"Now decide which is the most important:"
  37. 340 FORI=1TOF0:PRINTI;TAB(5);F$(I):NEXTI
  38. 350 PRINT"Which factor (by no.) is most important?"
  39. 360 INPUT"(Input 0 to change the list)";F2:PRINT
  40. 370 IFF2=0THEN260
  41. 380 IFF2<1ORF2>F0THEN350
  42. 390 PRINT"Suppose a scale of importance"
  43. 400 PRINT"from 0 to 10. Say ";F$(F2);" has a value"
  44. 410 PRINT"of 10 since it is at the top."
  45. 420 PRINT"What value would each of the others"
  46. 430 PRINT"have (decimal numbers are O.K.)?":FORI=1TOF0
  47. 440 IFI=F2THEN470
  48. 450 PRINTF$(I);:INPUTF(I):IFF(I)>=0ANDF(I)<=10THEN470
  49. 460 PRINT"   Your input is no good, try again.":GOTO450
  50. 470 NEXTI:F(F2)=10:C=0:FORI=1TOF0:C=C+F(I):NEXTI:FORI=1TOF0
  51. 480 F(I)=F(I)/C:NEXTI:PRINT:PRINT"Now consider how each ";S$
  52. 490 PRINT"rates for each of the factors."
  53. 500 PRINT"Consider each factor alone & rate each"
  54. 510 PRINTS$;" in terms of that factor only.":GOSUB900
  55. 520 PRINT"Let's consider ";L$(1);" to have a"
  56. 530 PRINT"value of 10 on each scale."
  57. 535 PRINT"Then every other ";S$;" will be given"
  58. 540 PRINT"a number higher or lower than 10"
  59. 550 PRINT"according to how much better or worse"
  60. 560 PRINT"than ";L$(1);" you think it is.":GOSUB900:FORI=1TOF0:PRINT
  61. 570 PRINT"Considering ";F$(I);" only, and"
  62. 580 PRINT"assuming ";L$(1);" to be 10,"
  63. 590 PRINT"what value would you give"
  64. 592 PRINT"to each of the following:"
  65. 595 M(1,I)=10
  66. 600 PRINT:FORJ=2TOL0
  67. 610 PRINTL$(J);:INPUTM(J,I):IFM(J,I)>=0THEN640
  68. 620 PRINT"No negative numbers. Try again.":GOTO610
  69. 640 C=C+M(J,I):NEXTJ:FORJ=1TOL0:M(J,I)=M(J,I)/C:NEXTJ:NEXTI
  70. 650 FORJ=1TOL0:V(J)=0:FORI=1TOF0:V(J)=V(J)+M(J,I)*F(I)
  71. 660 NEXTI:NEXTJ:FORI=1TO10:Z(I)=I:NEXTI:C=L0-1:FORJ=1TOL0
  72. 670 FORI=1TOC:N1=Z(I):N2=Z(I+1):IFV(N1)>V(N2)THEN690
  73. 680 Z(I+1)=N1:Z(I)=N2
  74. 690 NEXTI:NEXTJ:C1=Z(1):C2=Z(2):C=100/V(C1):FORJ=1TOL0
  75. 700 V(J)=C*V(J):NEXTJ:PRINT:PRINT:D=V(C1)-V(C2)
  76. 710 PRINT"Your best choice is ";L$(C1)
  77. 720 IFD<10THENPRINT"but it's pretty close."
  78. 730 IFD<20ANDD>=10THENPRINT"by a fair margin."
  79. 740 IFD>=20THENPRINT"by a good-sized margin."
  80. 750 GOSUB900:PRINT"Here's the final list with ";L$(C1)
  81. 760 PRINT"given a value of 100"
  82. 765 PRINT"and the others set accordingly.":GOSUB900
  83. 770 PRINTS$,"Rating"
  84. 780 FORJ=1TOL0:C=Z(J):PRINTL$(C),V(C):NEXTJ:GOTO810
  85. 790 PRINT"The number must be between 2 and 10.":RETURN
  86. 800 INPUT"Is this correct";B$:RETURN
  87. 810 INPUT"Do you have another case";A$
  88. 820 IFLEFT$(A$,1)<>"N"ANDLEFT$(A$,1)<>"n"THENRUN
  89. 840 MENU
  90. 900 PRINTRV$+">>Press any key to continue<<"+NO$:Z$=INPUT$(1):RETURN
  91.