Question
Create a new Java class called: CountFamilies Write a program that counts the number of families whose income is below a certain level. Begin your
Create a new Java class called: CountFamilies
Write a program that counts the number of families whose income is below a certain level.
Begin your program by asking the user to enter the number of families. Store this value in a variable called numOfFamilies.
Next, create an array whose size is numOfFamilies. After the array has been created, read numOfFamilies values, representing family incomes, from the keyboard and place them into the array.
Next, find the maximum income of all the values entered, and print this value to the screen.
Finally, count the families that make less than 10% of the maximum income. Display the income of each of these families, then display the count. Make sure you use correct grammar (i.e. 1 family, 2 families).
The following is an example of what your MIGHT see on the screen when your program runs. The exact output depends on what values that the user types in while the program runs. The user's values are shown below in italics:
Please enter the number of families: 5 Enter an income: 8500 Enter an income: 109000 Enter an income: 49000 Enter an income: 9000 Enter an income: 67000 The maximum income is: 109000 The incomes of families making less than 10% of the maximum are: 8500 9000 for a total of 2 families
Program Requirements
You must create and use a method named getMaximum. This method should receive one parameter, which is an array of integers. This method should search the array of integers to find and return the largest number in the list
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started