Question: Make a simple program that contains a main.c file and create multiple functions that takes an array of arbitrary length of numbers and adds them,
Make a simple program that contains a main.c file and create multiple functions that takes an array of arbitrary length of numbers and adds them, calculates the average, and finds the standard deviation. Use different arrays size and values to calculate the average, standard deviation, and sum.
main
the average is: x
the std is: x
the sum is: x
We will be creating a library from our lab assignment Follow the notes in the lecture to convert your math functions, sum, standard deviation, and average to a custom library that will be linked in the linkage stage. We will also be adding a custom structure data type and a custom print function for the array. Detailed instructions are below.
Step : Library creation
Create two files: statistics.h and statistics.c Statistics.h file will contain the funcion declarations. Stastics.c will contain the function implementation. Create a library of these two files that can be linked to ie when you compile in this step it should look something like
gcc o main main.c lm lstatistics
Ensure assigmment still operates as previously.
Step : New functionality
Add the functions to your new statistics library to find the maximum and minimum of a given input array. Finally, find the absolute value of the difference between the maximum and minimum.
Next, create an outputarray.c and outputarray.h that defines a function which takes the array and size as an input argument and outputs the array. Output the array to the screen using the new function in main.c Compilation should look like this:
gcc o main main.c outputarray.c lm lstatistics
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
