Question: Use C++ please. Goals: Reading data from file, using arrays and functions. Problem: You are to read a series of floating point numbers from a
Goals: Reading data from file, using arrays and functions. Problem: You are to read a series of floating point numbers from a text file store them in an array, then calculate the average of the values in that array. Your program should employ 2 functions other than main The first function should open the file, store the values in an array, count and return the number of values stored in the array to the function call The second function should calculate average of the values in the array and return the average of the values to the functiorn cal The name of the text file is Lab8.dat (do not edit or change the name of the file). Your main function should declare an array that could contain up to 400 floating point numbers, call the function to read the values from the file, call the function to calculate the average value, then output the number of values in the file and the average value in the file. You may want to create a smaller file for testing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
