Parallel arrays? Loading the arrays
via a
static method? Both those things look like iffy design to me. Who told you to use that sort of design?
I would give such a method
void instead of a return type. And why do you need a parameter for number of points? Can't you get that from the two arrays? Throw an exception if the two arrays aren't the same size.
It is easy enough to get a
double from a Scanner with its
nextDouble() method, but make sure you only write numbers. Maybe you could display this sort of thing:-
Next 2 numbers please: 123.45 234.56
Next 2 numbers please: 345.67 456.78
Finished