Question: answer using java (10 pts) Suppose you're analyzing demographic data collected from a poll. The data the age of one respondent. Consider two age groups:
answer using java

(10 pts) Suppose you're analyzing demographic data collected from a poll. The data the age of one respondent. Consider two age groups: "young" people are those between ages 18-35 (inclusive). n a D a aay ofint values. Each element in this array represents are those ages 36 and over. Write a method f i ndAveragea (int data) containing the average young" nd old ages from the array data The "young" average should be stored at index 0 of the returned array and "old" people that returns a ID array , and the "old" average should be below 18, they should be excluded. If there are no stored at index I. If any of the elements in data are elements that qualify as "young" or "old."use 1.0 in the corresponding index of he returned array full must NO For example, if data is the array 28, 0. -4, 17, 35, 1]. then calling findAvages (data) should retunm the array 31.5. 10. 31.5 is the average '"young" age in data, computed from 28 and 35. -1.0 indicates that there are no "old" ages in data. The other elements of data (0, 4, 17, 1) are igo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
