Pseudocode For Looking Up A Function
------------------------------------
initialisation:
open file
while not feof :
read x
read y
store y in array position x
close file
interpolation:
select value of x
if we know y(x)
set y = y(x)
otherwise
if x is lower than lowest x in array
set s = complaint
set y = nan
otherwise
if x is higher than highest x in array
set s = complaint
set y = nan
otherwise
get highest value of x in array which is lower than x (x1)
get lowest value of x in array which is higher than x (x2)
evaluate y = y(x1) + (y(x2)-y(x1))/(x2-x1) * (x-x1)
if not y = nan,
print y
otherwise
print complain