Please explain the code with comments!!
C programming Measurement analysis
Using computer programs for measurement of data collection and analysis is very common.
You should write a well-structured program where you can enter measurement values and analyze them.
/* Please remember to include comments to the code */
When the program starts, the user gets a menu where he can choose:
v (View) – displays the measured values stored
e (Enter) – allows the user to add measurement values
c (Compute) – presents max, min, mean and normalized metrics
r (Reset) – deletes all input measured values
q (Quit) quites the program .
The user must make his choice by entering a letter.
(View ).Displays the program values currently stored in the program. Must be able to handle zero metrics.
(Enter). The user can enter the measured values (positive integers) here until he inputs zero or the total number of measured values stored is ten.
Then the entry ends and the user returns to the main menu. Note that if the user selects this option multiple times, the new metrics will be added. Previously entered measurement values should remain. If you choose this option when the program already contains ten measured values, you can not enter any new values.
(Compute ).Uses the current data stored in the program to calculate and present: Max – the maximum value Min – the minimum value .
Average – the average of all measurement data. Note that this should be calculated as a decimal and presented with two decimals. Normalized measurement values - In this case, normalized measurement values mean subtracting the mean value from each measurement value and rounding to integers.
If you have measured values [2 5 7] you get normalized measurement values [-3 0 2] and these are to be presented.
Clarification: Arrays should be used correctly and efficiently with appropriate loop constructions. The program should properly divide its work with functions and send data between functions using in-parameters and returned values. No global variables are allowed.
The program should consist of a main function which should contain the code for our menu.
Menu choices one to four (and preferably five) should be handled in a function called when the user makes each selection. The menu selection calculator function, in turn, will call help features to solve its tasks. Output should look like this:
The output should be like this:
[No measurements ] VECRQ ?
e Enter measurement # 1 (or 0) ?1
Enter measurement # 2 (or 0 ) ? 2
Enker mucsurement # 3 (or 0) ? 3
Enter measurement # 4 (or 0) ? 0
VEC RQ? v [1 2 3]
VECRQ ? e
Enter measurement # 4 (or 0 ) ? 4
Enter measurement # 5 (or 0) ? 5
Enter measurement #6 (or 0)? 0
VECRQ ? v [1 2 3 4 5]
c Max value: 5 Min value : 1 Avr Value : 3.00 [ -2 -1 0 1 2] VECRQ ,
Exit measurement tool!