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

  1. 0 'DECIDE.BA - BY PHIL WHEELER
  2. 1 'CLUB 100 LIBRARY - 415/939-1246 BBS,    937-5039 NEWSLETTER, 932-8856 VOICE
  3. 2 'adapted from an MBASIC version found
  4. 3 'on an RCP/M. It can be a game or a
  5. 4 'tool. It is not compact (the Byte
  6. 5 'Fyter could make mincemeat of this;
  7. 6 'but I'd rather he worked on MVCWM --
  8. 7 'a truly worthwhile program). Remove
  9. 8 'editorial after downloading.
  10. 9 '    Phil Wheeler
  11. 10 CLEAR500:DIMF$(10),L$(10),F(10),M(10,10),V(10),Z(10),Z$(1):RV$=CHR$(27)+"p":NO$=CHR$(27)+"q":PRINTRV$+"                DECISION                "+NO$:PRINT"Which best describes the type of":PRINT"decision you have to make:":PRINT"(1) Choose an item"
  12. 11 PRINT"(2) Choose a course of action"
  13. 12 INPUT"Which type (1 or 2)";C:IFC<1ORC>2THENPRINT"ILLEGAL CHOICE.":GOTO12
  14. 13 PRINT:IFC=1THENPRINT"What type of item is it that you"
  15. 14 IFC=1THENINPUT"need to decide upon";S$
  16. 15 IFC=2THENS$="Action"
  17. 16 PRINT:PRINT"Now list each ";S$:PRINT"being considered,one at a time.":PRINT"The order is not important."
  18. 17 PRINT:INPUT"   First, how many are there ";L0:IFL0>=2ANDL0<=10THEN19
  19. 18 GOSUB39:GOTO17
  20. 19 PRINT:FORI=1TOL0:PRINT"Number";I;"please";:INPUTL$(I):NEXTI:PRINT:FORI=1TOL0:PRINTI;TAB(5);L$(I):NEXTI:PRINT:GOSUB40:IFLEFT$(B$,1)<>"Y"ANDLEFT$(B$,1)<>"y"THEN16
  21. 20 PRINT:PRINT"How many factors are important":PRINT"in choosing a ";S$;:INPUTF0:IFF0>=1ANDF0<=10THEN22
  22. 21 GOSUB39:GOTO20
  23. 22 PRINT:PRINT"I need a list of each of these factors.":FORI=1TOF0:PRINT"Factor number";I;:INPUTF$(I):NEXTI:GOSUB43:PRINT"Now decide which is the most important:":FORI=1TOF0:PRINTI;TAB(5);F$(I):NEXTI
  24. 23 PRINT"Which factor (by no.) is most important?":INPUT"(Input 0 to change the list)";F2:PRINT:IFF2=0THEN20
  25. 24 IFF2<1ORF2>F0THEN23
  26. 25 PRINT"Suppose a scale of importance":PRINT"from 0 to 10. Say ";F$(F2);" has a value":PRINT"of 10 since it is at the top.":PRINT"What value would each of the others":PRINT"have (decimal numbers are O.K.)?":FORI=1TOF0:IFI=F2THEN28
  27. 26 PRINTF$(I);:INPUTF(I):IFF(I)>=0ANDF(I)<=10THEN28
  28. 27 PRINT"   Your input is no good, try again.":GOTO26
  29. 28 NEXTI:F(F2)=10:C=0:FORI=1TOF0:C=C+F(I):NEXTI:FORI=1TOF0:F(I)=F(I)/C:NEXTI:PRINT:PRINT"Now consider how each ";S$:PRINT"rates for each of the factors.":PRINT"Consider each factor alone & rate each":PRINTS$;" in terms of that factor only.":GOSUB43
  30. 29 PRINT"Let's consider ";L$(1);" to have a":PRINT"value of 10 on each scale.":PRINT"Then every other ";S$;" will be given":PRINT"a number higher or lower than 10":PRINT"according to how much better or worse"
  31. 30 PRINT"than ";L$(1);" you think it is.":GOSUB43:FORI=1TOF0:PRINT:PRINT"Considering ";F$(I);" only, and":PRINT"assuming ";L$(1);" to be 10,":PRINT"what value would you give":PRINT"to each of the following:":M(1,I)=10:PRINT:FORJ=2TOL0
  32. 31 PRINTL$(J);:INPUTM(J,I):IFM(J,I)>=0THEN33
  33. 32 PRINT"No negative numbers. Try again.":GOTO31
  34. 33 C=C+M(J,I):NEXTJ:FORJ=1TOL0:M(J,I)=M(J,I)/C:NEXTJ:NEXTI:FORJ=1TOL0:V(J)=0:FORI=1TOF0:V(J)=V(J)+M(J,I)*F(I):NEXTI:NEXTJ:FORI=1TO10:Z(I)=I:NEXTI:C=L0-1:FORJ=1TOL0:FORI=1TOC:N1=Z(I):N2=Z(I+1):IFV(N1)>V(N2)THEN35
  35. 34 Z(I+1)=N1:Z(I)=N2
  36. 35 NEXTI:NEXTJ:C1=Z(1):C2=Z(2):C=100/V(C1):FORJ=1TOL0:V(J)=C*V(J):NEXTJ:PRINT:PRINT:D=V(C1)-V(C2):PRINT"Your best choice is ";L$(C1):IFD<10THENPRINT"but it's pretty close."
  37. 36 IFD<20ANDD>=10THENPRINT"by a fair margin."
  38. 37 IFD>=20THENPRINT"by a good-sized margin."
  39. 38 GOSUB43:PRINT"Here's the final list with ";L$(C1):PRINT"given a value of 100":PRINT"and the others set accordingly.":GOSUB43:PRINTS$,"Rating":FORJ=1TOL0:C=Z(J):PRINTL$(C),V(C):NEXTJ:GOTO41
  40. 39 PRINT"The number must be between 2 and 10.":RETURN
  41. 40 INPUT"Is this correct";B$:RETURN
  42. 41 INPUT"Do you have another case";A$:IFLEFT$(A$,1)<>"N"ANDLEFT$(A$,1)<>"n"THENRUN
  43. 42 MENU
  44. 43 PRINTRV$+">>Press any key to continue<<"+NO$:Z$=INPUT$(1):RETURN
  45.