Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions