This is a JSFiddle assignment and must be completed at jsfiddle.net and include both the HTML and Java sections

An interpolation table is a specific instance of a Lookup Table - which is also a practical application of indexing, in this case numeric indexes. You will create a computer program that uses the following lookup table (interpolation table), allows a user to input a number and calculates the answer by interpolating between 2 numbers - or finds an exact solution.

The table gives the amount of total rainfall (normalized to 1) that occurred during a rainfall event. For example at hour 3, 0.6 or 60% of the total rain had fallen. You will need to create a function that allows me to enter a number between 0 and 6, and it must return the total amount of rainfall that has occurred. I must also be able to enter fractional numbers - for example if I enter 4.5 it should return 0.91 by using interpolation (use standard linear interpolation -https://en.wikipedia.org/wiki/Interpolation )

0 0.00
1 0.04
2     0.11
3     0.60
4     0.87
5     0.95
6     1.00

Solution

HTML:- Interpolation
Enter Start:
Enter Stop:
Enter Count:
This is a JSFiddle assignment and must be completed at jsfiddle.net and include both the HTML and Java sections An interpolation table is a specific instance of
interpolate.java //Logic to catch paramters form html form int start = request.getParameter(\"start\"); int end = request.getParameter(\"end\"); int cout = request.getParameter(\"count\"); // Write here some code that will call function interpolate(double start, double end, int count) //Main logic for caluting interpolation public static double[] interpolate(double start, double end, int count) { if (count < 2) { throw new IllegalArgumentException(\"interpolate: illegal count!\"); } double[] array = new double[count + 1]; for (int i = 0; i <= count; ++ i) { array[i] = start + i * (end - start) / count; } return array; } You can complete this assignment in html serverlet or jsp you just need to use above code in proper way logic is there. If you have any query or need help fell free to reach.