1) Build an algorithm in order to read an arbitrary number of data records, each containing of the name, age, and code. A Code of 1 will signify female, a code of 2 specifies male; and a code of 0 specifies that the end-of-file has been achieved. For each record, write down a detailed line listing the person's name and age. In addition, compute and output the following values:
a) Number of males less than or equal to 21 yrs old.
b) Number of females less than or equal to the 21 years old.
c) Average age of all persons over 21.
d) Total number of the people.