Calculating average height of N people in C++

Hello! How do I make a program in C++ in which the heights of N number of people will be input in centimeters? Also, all of the following should be included:
The entered values can be repeated. The interval of entered heights should be between 150 and 200 centimeters. In case of height input outside this interval, it should not be accepted.
-Calculate the average height
-Set aside those values of heights that vary by +/- 10 centimeters of the average height.
-Set aside those values for the heights that vary from 0 to + 15% in relation to the minimum height and from 0 to -20% in relation to the maximum height. It is recommended to work with functions.
The results should be tested in 3 rows, that will have the same number of elements.
Any ideas of how do I make this program?
Topic archived. No new replies allowed.