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

Could anyone please do this questions for me using javaprogramming (1)Write a me

ID: 3613241 • Letter: C

Question

Could anyone please do this questions for me using javaprogramming

(1)Write a method called isEven that takes a parameter andprints a message on the screen,
depending on whether the given number is odd or even. You need todecide for yourself
what are the appropriate parameter types. Use a return type ofvoid.
Then, to test your method, do the following. In the main method,call the method twice,
giving an odd number as the input parameter, and then an evennumber.


(2)Now change your isEven method in Exercise (1) to return a resultinstead of printing
something on the screen. You need to decide for yourself what is anappropriate return
type to use. There should be no print statements inside the isEvenmethod.
Instead, you should have print statements inside the main method,from where you are
using the isEven method. You will have to make other changes to thecode in the main
method so that you are able to get the results that the isEvenmethod gives you to print
the correct messages on the screen.


I really appreciate any answer for this question.
Thank you very much

Explanation / Answer

import java.util.*;

publicclass Even

{

publicstatic voidmain(String[] a){

isEven(25);

}

privatestatic voidisEven(inti) {

if(i % 2==0){//checks for even number

System.out.println("the number is even");

}else{

System.out.println("the number is odd");

}

}

if(isEven(25)== true){

System.out.println("the number is even");

}else{

System.out.println("the number is odd");

}