Repeat Exercise 2 in Chapter 7, but use an instance of ArrayList instead of an array. Do

Question:

Repeat Exercise 2 in Chapter 7, but use an instance of ArrayList instead of an array. Do not read the number of values, but continue to read values until the user enters a negative value.


Exercise 2 in Chapter 7

Write a program in a class CountFamiles that counts the number of families whose income is below a certain value. Read an integer k from the keyboard and then create an array of double values of size k. Read k values representing family income from the keyboard and place them into the array. Find the maximum income among these values. Then count the families that make less than 10 percent of this maximum income. Display this count and the incomes of these families.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: