Question: 1) Write a method named equalSpace that takes three parameters: an int (n) and two doubles (lo,hi). The method will return an array of n
1) Write a method named equalSpace that takes three parameters: an int (n) and two doubles (lo,hi). The method will return an array of n double values. The array will contain equally spaced values between the endpoints, lo and hi.
2) Assume there is a printArray method that takes one parameter, an array of doubles, and print it to System.out, as follows:
{2.0 : 3.5 : 5.0 : 6.5 : 8.0}
Call the equalSpace and printArray methods to print out the following:
{5.0 : 3.0 : 1.0} (Extrac Credit if you do this in one line of code.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
