I am working on an assignment with the following instructions,
Write a method that will load an array of floating point numbers from a file named floats.txt that you create, and then return that array. Assume the first value in the file holds the size of the array. Be sure to call your method.
I have created the following file with the title floats.txt
5
4.3
2.4
4.2
1.5
7.3
I have never written a method that will return an array, nor have I ever created an array that reads from a file. Not asking anyone to write the program for me, by any means, but would appreciate some suggestions to get me started. I have written the method header as follows,
public static double[] floatingFile() throws IOException {
Scanner fin = new Scanner(new File"floats.txt");
Thanks.