Functions and call by reference



Write a program that first reads the height of each student in a school class. Then, the program
should display the height of all students, sorted increasingly, at most 5 values per line. Moreover,
if the height of a student is below the average then it should be marked with symbol ‘-‘.
Otherwise, the height is marked with symbol ‘+’.
You may assume that a class has at most 100 students. The user indicates the end of the list of
pupils’ heights by typing a non-numeric value (e.g. “STOP”) and only positive integers are
entered, otherwise.
Structure your program with the help of functions and no loops should appear in the main
function.
An example is given below. Values in green color are entered by the user.
Example
Enter the height of each student:
175 167 160 164 183 187 188 179 176 175
169 175 176 178 165 160 173 165 187 178 STOP
Students height:
160- 160- 164- 165- 165-
167- 169- 173- 175+ 175+
175+ 176+ 176+ 178+ 178+
179+ 183+ 187+ 187+ 188+


Am i supposed to create some functions and later on call them in the main?? Im not getting the hang of this... Help, please :(
Topic archived. No new replies allowed.