parameter and prints

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 questio

Comments are closed.