Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to write a program with an array that generates 10 randomintegers between

ID: 3614773 • Letter: I

Question

I need to write a program with an array that generates 10 randomintegers between 0-9 and have it count the number of even and oddnumbers. So far, I've done this but I can't seem to make it countthe even/odds:
public class LabArrayFive { public static void main(String[] args) {
// declare an integer array with 10 elements int [] myScore = new int[10]; int i; // initialize an array with random numbers for (i = 0; i < myScore.length; i++) myScore[i] = i (Math.random()); // print an array for (i = 0; i < myScore.length; i++) System.out.println("myScore[" + i + "]= " + myScore[i]); // count even and odd numbers using array elements asindices int [] count = new int[2]; for (i = 0; i >= myScore.length; i++) count[myScore[i]] = count[myScore[i]] + 2; System.out.println("The number of even numbers = " +count[1]); System.out.println("The number of odd numbers = " +count[0]); System.out.println("Done!"); } }
public class LabArrayFive { public static void main(String[] args) {
// declare an integer array with 10 elements int [] myScore = new int[10]; int i; // initialize an array with random numbers for (i = 0; i < myScore.length; i++) myScore[i] = i (Math.random()); // print an array for (i = 0; i < myScore.length; i++) System.out.println("myScore[" + i + "]= " + myScore[i]); // count even and odd numbers using array elements asindices int [] count = new int[2]; for (i = 0; i >= myScore.length; i++) count[myScore[i]] = count[myScore[i]] + 2; System.out.println("The number of even numbers = " +count[1]); System.out.println("The number of odd numbers = " +count[0]); System.out.println("Done!"); } } public class LabArrayFive { public static void main(String[] args) {
// declare an integer array with 10 elements int [] myScore = new int[10]; int i; // initialize an array with random numbers for (i = 0; i < myScore.length; i++) myScore[i] = i (Math.random()); // print an array for (i = 0; i < myScore.length; i++) System.out.println("myScore[" + i + "]= " + myScore[i]); // count even and odd numbers using array elements asindices int [] count = new int[2]; for (i = 0; i >= myScore.length; i++) count[myScore[i]] = count[myScore[i]] + 2; System.out.println("The number of even numbers = " +count[1]); System.out.println("The number of odd numbers = " +count[0]); System.out.println("Done!"); } }

Explanation / Answer

please rate - thanks lines I changed are in red public class LabArrayFive { public static void main(String[] args) { // declare an integer array with 10 elements int [] myScore = new int[10]; int i; // initialize an array with random numbers for (i = 0; i