A component used in the electronic cruise control as designed for passenger cars contains a relatively simple electronic circuit board. These boards are mass-produced by a low-cost supplier and purchased for assembly in a variety of cars. As shipments of these boards are received, samples for testing are selected at random. One test (of many) measures the electrical resistance of the circuit (in ohms). Shown below are the results of ten such measurements on sample units.
Save the provided file resist.txt in the same folder as your source file.
Write a program that begins by inputting the values from resist.txt and storing them in an array named resist[]. Define your array to hold up to 100 elements, although this exercise uses only ten. Be sure to follow the style requirements discussed for handling array limits. Do not hardcode the number of values anywhere (we may use this program with other input files). Instead, read until the end-of-file is detected and "remember" the number of values read. Then write a series of functions, using these given names:
findMax() // finds the maximum value
findMin() // finds the minimum value
calcMean() // calculates the mean (average)
geomMean() // calculates the geometric mean
rmsAvg() // calculates the root mean squared average
harmMean() // calculates the harmonic mean
sortValues() // sorts the values into numerical order
The purpose of each function should be clear. Pass to each the array and the appropriate limit. The following formulations will help:
where n is the number of values
where n is the number of values
where n is the number of values
Call all seven functions, one at a time, in the order shown above. Output the results of each function to the console, as they are called, resulting in the format shown below. The last function must sort the array, and then, after calling it, main() must output it using a simple for-loop (not a while-loop). Your main() function should be relatively simple.
Required Output Format (note the required precision of each value):
Joe Student, Program 9
Sample Resistance Study
The maximum value is xxx.xx
The minimum value is xxx.xx
The mean is xxx.xxxxxx
The geometric mean is xxx.xxxxxx
The rms average is xxx.xxxxxx
The harmonic mean is xxx.xxxxxx
The sorted list of values is: xxx.xx
xxx.xx
xxx.xx
xxx.xx
xxx.xx
xxx.xx
xxx.xx
xxx.xx
xxx.xx
xxx.xx
Here is what the txt file entails
128.35
130.44
129.33
128.75
129.22
130.21
128.56
129.45
129.88
129.12
what do you want from us here? to do your homework? make an attempt then when you are stuck and only then will you get help, if you need a private tutor that i can do...