A function is defined as follows:
The complete program computes the values of the function within a specified interval, Xmin to Xmax, using the specified step size, Xstep, i.e. compute the function at the values Xmin, Xmin + Xstep, Xmin + 2*Xstep, ..., Xmax.
The file /usr/copy/aps105/funcs.t contains the code that does most of this. There are two modules that do not exist: GetParameters, and Compute. The GetParameters module gets the three parameters as input. You may assume that only real numbers in the correct range will be input for these parameters. The Compute module returns the value of the function based on its input parameter.
The code in funcs.t reads as follows:
loop var Xmin,Xmax,Xstep,X : real var Y : real GetParameters(Xmin,Xmax,Xstep) exit when Xstep = 0 X := Xmin loop var temp : real Y := Compute(X) put X:8:3," ",Y:8:3 temp := X + Xstep exit when temp > Xmax X := temp end loop if X not= Xmax then Y := Compute(Xmax) put Xmax:8:3," ",Y:8:3 end if end loop
You may include the code of funcs.t either by copying from the file /usr/copy/aps105/funcs.t
into your file ``part2.t'' or by simply having the statement include "/usr/copy/aps105/funcs.t"
after the declaration of your modules.
The modules you write may not use any global variables and they are not to output anything. You may not change the code you import from funcs.t in any way.