Implement a table as an array, predefine this.
Interpolation, simply search the array until you find the two array entries that lie between your sample, work out how far your sample is from the lower entry as a fraction of the difference between entries, and apply that to the index (array position) you found. Sounds much more complex written down that it actually is.