Question: Java !!! plz!!! Java import java.util.*; import java.io.*; public class Lab5{ static int array[] = { 26, 52, 96, 84, 87, 31, 37, 30, 95,
Java !!! plz!!! Java

import java.util.*; import java.io.*;
public class Lab5{ static int array[] = { 26, 52, 96, 84, 87, 31, 37, 30, 95, 35, 75, 34, 91, 27, 78, 60, 29, 65, 57, 70 }; public static void main( String args[] ){ System.out.println("indexOf largest even number array is: " + indOfMaxEven(array)); } static boolean isEven(int n){ //YOUR CODE HERE } static int indOfMaxEven( int [] input ){ // RETURN INDEX OF LARGEST EVEN NUMBER IN ARRAY. // YOU MUST USE THE isEven() method
} }
Index of the Max Even Number in an Array Write a program that given an array of integers variable called array prints in the console the index of the largest even number in the array. Please note that you have to complete the methods isEven(int n) and indof MaxEven (int[] input). . 1 limport java.util.* 2 import java.io.*; 3 public class Lab5{ 6 static int array[] = { 26, 52, 96, 84, 87, 31, 37, 30, 95, 35, 75, 34, 91, 27, 78, 60, 29, 65, 57, 70 }; 00 - public static void main( String args[] ) { 9 10 System.out.println("indexOf largest even number + indofMaxEven(array)): array is: } 11 12 13 static boolean isEven(int n) { //YOUR CODE HERE 14 15 16 17 } 18 19 20 21 22 23 static int indofMaxEven( int [] input ) { // RETURN INDEX OF LARGEST EVEN NUMBER IN ARRAY. // YOU MUST USE THE isEven() method 24 25 } 26 }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
