Question: 3A. Complete load_pts_file function that reads multiple pairs of numbers from a file and finds the distance between every two numbers on a number line:

3A. Complete load_pts_file function that reads multiple pairs of numbers from a file and finds the distance between every two numbers on a number line: Few steps as the guidance 1) Open/Read the .dat file into a pre-allocated given space, data_buffer. 2) The format is fixed in every single line of the file, parse the content and interpret each as an integer number. 3) Finding distances from the every-two-number, iteratively store the distance to an integer array (note: the base address is given in $a1 ). 4) Return the number of distances calculated. For example, The above example shows that load_pts_file function - opens/reads lab3_pts.dat file (into data_buffer), - parses and interprets ' 1 ' as the integer numbers, 1 , and ' 2 ' as 2 - finds the distance of 1 and 2 to be 1 and updates the distance array - repeats the above two until the end of file, then returns 4 distances calculated. NOTE: you can safely assume I. the file will strictly follow such SPACE >
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
