1000 rem aaii program no. 7 -- stock valuation calculator 1010 rem by robert osterlund of aaii. (c) copyright 1985 by 1020 rem the american association of individual investors. 1030 rem from the november 1985 issue of computerized investing. 1040 rem for a stock with zero current dividends and earnings, instead use 1050 rem nonzero historical averages of dividends and earnings. 1060 rem for the equity risk premium, try using the historical average, 6.2%. 1070 rem when analyzing the combined effect of changing more than one variable, 1080 rem be sure to modify lower-numbered variables before higher-numbered ones. 1090 rem also, never specify a dividend growth rate >= required return. 2000 rem initialization routine 2010 dim v$(12), v(12) 2020 for i=0 to 12: read v$(i): next i 2030 data "stock valuation calculator" 2040 data " 1> stock price ($)", " 2> current dividends ($)" 2050 data " 3> current earnings ($)", " 4> stock beta" 2060 data " 5> equity risk premium (%)", " 6> t-bill rate (%)" 2070 data " 7> payout ratio (%)", " 8> required return (%)" 2080 data " 9> dividend growth (%)", "10> dividend yield (%)" 2090 data "11> price/earnings ratio", "--> stock valuation ($)" 2100 def fn pt(x) = abs(mid$(v$(x),len(v$(x))-1,1)="%") 2110 f = .0000001 3000 rem data input routine 3010 print chr$(26): rem clear screen 3020 print tab(7) v$(0) 3030 print: print 3040 for i=1 to 6 3050 print mid$(v$(i),5); 3060 input v(i): if fn pt(i) then v(i) = v(i)/100 3070 next i 4000 rem computation routine 4010 v(7) = abs(v(3)<>0)*v(2)/(v(3)+f) 4020 v(8) = v(6) + v(4)*v(5) 4030 v(9) = v(6) + v(4)*v(5) - v(2)/v(1) 4040 v(10) = v(8) - v(9) 4050 v(11)=abs(v(3)<>0)*(abs(v(2)<>0)*v(7)/(v(10)+f)+abs(v(2)=0)*v(1)/(v(3)+f)) 4060 v(12)=abs(v(3)<>0)*v(11)*v(3)*(1+v(9))+abs(v(3)=0)*v(2)*(1+v(9))/(v(10)+f) 5000 rem data output routine 5010 print chr$(26): rem clear screen 5020 print tab(7) v$(0) 5030 print: print 5040 for i=1 to 12 5050 print v$(i); ":"; tab(30); 5060 print int(v(i)*10^(2+2*fn pt(i))+.5)/100 5070 if (i=6) or (i=11) then print 5080 next i 6000 rem menu routine 6010 print: print 6020 print "enter 1-11 to modify that variable, 12" 6030 print "to refigure all data, or 0 to quit"; 6040 input a$: a% = val(a$) 6050 if a% = 0 then if a$ <> "0" then 6020 6060 if (a%=0) or (a%=12) then 6120 6070 print 6080 print "the new "; mid$(v$(a%),5); 6090 input v(a%) 6100 if fn pt(a%) then v(a%) = v(a%)/100 6110 if ((a%=8)or(a%=9)) and (v(9)>=v(8)) then print "illegal value": goto 6080 6120 on a% goto 4000,4000,4000,4000,4000,4000,4020,4030,4040,4050,4060,4000 6130 end