1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Fantom [35]
3 years ago
10

in java how do i Write a method named isEven that accepts an int argument. The method should return true if the argument is even

, or false otherwise. Also write a program to test your method.
Computers and Technology
1 answer:
Veseljchak [2.6K]3 years ago
3 0
<h2>Answer:</h2><h2>============================================</h2>

//Class header definition

public class TestEven {

   

   //Method main to test the method isEven

   public static void main(String args[ ] ) {

       

       //Test the method isEven using numbers 5 and 6 as arguments

       System.out.println(isEven(5));

       System.out.println(isEven(6));

     

   }

   

   //Method isEven

   //Method has a return type of boolean since it returns true or false.

   //Method has an int parameter

   public static boolean isEven(int number){

       //A number is even if its modulus with 2 gives zero

      if (number % 2 == 0){

           return true;

       }

       

       //Otherwise, the number is odd

       return false;

   }

}

====================================================

<h2>Sample Output:</h2>

=========================================================

false

true

==========================================================

<h2>Explanation:</h2>

The above code has been written in Java. It contains comments explaining every part of the code. Please go through the comments in the code.

A sample output has also been provided. You can save the code as TestEven.java and run it on your machine.

You might be interested in
In order to average together values that match two different conditions in different ranges, an Excel user should use the functi
Tomtit [17]
In order to average together values that match two different conditions in different ranges, an Excel user should use the Excel Average functions.<span>To calculate average in Excel,the powerful Excel Average functions will do the work behind the scene.  </span>You use the AVERAGE function in Excel to return the average (arithmetic mean) of the specified cells. The different functions are : <span><span>Excel AVERAGE - calculate the mean of cells with numbers.  </span><span>Excel AVERAGEA - find an average of cells with any data. </span><span>Excel AVERAGEIF - average cells based on a given criterion. </span><span>Excel AVERAGEIFS - average cells that match several criteria.</span></span>
6 0
2 years ago
The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create
Oksi-84 [34.3K]

Answer:

False.  

Explanation:

In this question some information is missing the question does not mention which type of question is this. This question is a true/false type question.

isometric projection camera is an engineer or the technical drawing in which we represented the 3D(three dimensional) objects in the 2D(Two dimensional) objects. This camera representing the object in a visual manner. isometric projection is also known as Isometric drawing, In the isometric projection camera, all the angles are equal. It does not provide an illusion perspective by using parallax scrolling to create the illusion of 3D in a 2D game.

3 0
2 years ago
Digital cameras are less susceptible to UV light.Select one of the options below as your answer:A. TrueB. False
horrorfan [7]
<span>Digital cameras are less susceptible to UV light. TRUE. In fact, there is an existing photography called Ultraviolet Photography. It is a process of photography that records images by using the light from the ultraviolet spectrum. There are two possible ways to use UV in taking photographs: via reflected UV and UV induced fluorescence.</span>
4 0
3 years ago
Read 2 more answers
Custodial workers that access the terminal area must have a fingerprint background check done and training unless they are escor
tensa zangetsu [6.8K]

Answer:

True they do. mark brainliest.!!!!! please

Explanation:

6 0
2 years ago
How do airbags prevent injury?
NARA [144]

honestly i think ur answer would be D because it keeps you from flying out of the window

8 0
3 years ago
Other questions:
  • Which of the following is an example of subjunctive verb mood?
    5·1 answer
  • Why was the term personal computer created?
    5·1 answer
  • \What will the weather most likely be like the day after a warm front? (4 points) The temperature will be cool or cold, and ther
    7·2 answers
  • How to interchange first half of the array with second half of array in python?
    9·1 answer
  • In paragraph form, explain and describe at least three common situations in which you would yield the right-of-way.
    5·1 answer
  • Why is an increase in tax rate not necessarily increase government revenue​
    10·1 answer
  • PLZ HELP ASAP
    13·1 answer
  • The post-closing trial balance shows the balances of only the ____ accounts at the end of the period.
    12·1 answer
  • QueSUUN TU
    15·1 answer
  • A _____________ delivers all the files that form web pages
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!