with Text_io, IIO; use Text_io; procedure FIBO is -- Calculate Fibonaci's Numbers - using Tasks package IIO is new Text_IO.Integer_io(integer); --need integer output function FIBONACI(N:POSITIVE) return POSITIVE; --hides a neat trick task type FIBS_NUMBER is entry Get(ID:POSITIVE; F:out positive);-- ID identifes which number entry STOP; end FIBS_NUMBER; MAX:constant:=30; subtype INDEX is INTEGER range 1..19; FIB:array(INDEX) of FIBS_NUMBER; N:NATURAL; F:POSITIVE; task body FIBS_NUMBER is separate; -- source in fibonaci.sub function FIBONACI(N:POSITIVE)return POSITIVE is F:POSITIVE; begin if N not in INDEX then Put("FIBONACI not implemented"); raise numeric_error; end if; FIB(N).Get(N,F); return F; end FIBONACI; begin loop Put("Input a number (0 to stop): "); iio.Get(N); exit when N=0; New_Line; F:=FIBONACI(N); Put("Fib("); iio.Put(N); Put(")=");iio.PUT(F);New_Line; end loop; Put("MAIN STOP"); for N in FIB'RANGE loop FIB(N).STOP; end loop; end FIBO;