1. Create arr, an array of size six. Each element of arr is a random two-digit positive integer. (The program should make a random selection using the function rand.) Print the elements of arr.

  2. Compute x as the average of the array. Print x.

  3. Compute y as the average of those entries that are greater than or equal to x. Print y. **Check the answer by hand, to make sure you did it correctly.

    For example, if the array contains 11, 11, 33, 33, 55, and 55, x is 33 (the average of all six numbers) and y is 44 (the average of 33, 33, 55, and 55).

  4. Find how many times the digit six appears in arr (you may want to use the recursive function sixCount from Lab #9). Print it.

For example, if the array contains 11, 11, 11, 26, 62, and 66, the output should read: “There are 4 sixes.”

Recommended Answers

All 2 Replies

And the problem is...?

Post what you've done so far, so that we can help you.

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.