Here's the problem:
"Daily life magazine wants an analysis of the demographic characteristics of its readers. The Marketing department has collected reader survey records containing the age, gender, marital status, and annual income of readers. Design an application that accepts reader data and produces a count of readers by age groups as follows: under 20, 20-29, 30-39, 40-49, 50 and older."

I know that the answer should include an array but i'm very confused as to how to search the array then organize the results by age groups. I if you can help, this assignment is due at midnight tonight so please hurry, thanks!

Recommended Answers

All 2 Replies

Design an application that accepts reader data and produces a count of readers by age groups as follows: under 20, 20-29, 30-39, 40-49, 50 and older."

Essentially these are your requirements and the rest of the paragraph didn't matter whatsoever. I don't really see how we can help without designing the algorithm for you, but as a hint, consider that you only need to do these things:

1. create an array of size 5, one for each of your age groups, anmd initialize each index of the array to 0.
2. read in data and based on what age group each piece of data fits into, add one to the appropriate array index.

that was very helpful, thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.