Question: 15. Write a Java program named Occurrence that asks the user to enter 10 integer numbers and store them in an array. Then it should
15. Write a Java program named Occurrence that asks the user to enter 10 integer numbers and store them in an array. Then it should ask the user to enter an integer number (x) using an appropriate message. Then it should count and display the occurrences of the entered number (x) in the array Enter 10 integer numbers: 27 3 176 17 12 76 19 1 Enter an integer number 1 The number 1 occurs 3 times in the array 16. Write a complete java program called EvenNumbers that has two static methods: main and percentEven. The main method should: 1. Allow the user to enter 10 integer numbers and store them in a one-dimensional array. 2. Call the method percentEven and pass to it the array reference that you created. 3. Print out the returned result by percentEven method. The percentEven method should: 1. Accept an array of integers. 2. Identify how many even numbers in the array. 3. Calculate and return the percentage of even numbers in the array For example, if the array the elements are: 16, 2, 9, 10, 3. 1, 8, 7, 4, 5) then your method should return 50.0. If the array contains no even elements or no elements at all then your method should return 0.0. percentage of even numbers total number of even numbers x 100 total number of all numbers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
