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
NemiM [27]
3 years ago
6

Write a program that reads an integer and determines and prints whether it's odd or even. [Hint: Use the remainder operator (%).

An even number is a multiple of two. Any multiple of 2 leaves a remainder of zero when divided by 2.]
Computers and Technology
1 answer:
Sloan [31]3 years ago
4 0
<h2>Explanation:</h2>

The source code, written in Java, and a sample output have been attached to this response. It contains comments explaining certain parts of the code.

A few things to note are;

(i) The Scanner class is imported to allow user's interact with the program. This is done by writing the import statement at the top of the code as follows;

<em>import java.util.Scanner;</em>

<em />

(ii) An object of the Scanner class is created to receive inputs from the user. The object is called input and created as follows;

<em>Scanner input = new Scanner(System.in);</em>

(iii) Since the user is expected to enter an integer, the nextInt() method of the Scanner object is used to receive the integer and this is saved in a variable called <em>number. </em>i.e

<em>int number = input.nextInt();</em>

<em></em>

(iv) A number x, is even if its remainder when divided by 2 is 0. i.e

if x % 2 = 0, then x is even. Otherwise it is odd.

The user's input received and saved in a variable called <em>number </em>is then checked using if and else blocks to check if it is even or not and can be written as follows;

<em>if(number % 2 == 0){</em>

<em>    System.out.println(number + " is even");</em>

<em>}else {</em>

<em>    System.out.println(number + " is odd");</em>

<em>}</em>

You might be interested in
Which plan includes procedures and processes that ensure the smooth functioning of the business even after a disaster?
mamaluj [8]

Answer:

The plan that includes procedures and processes that ensure the smooth functioning of the business even after a disaster is the:

business continuity and disaster recovery plan.

Explanation:

An entity that has good business continuity and disaster recovery plan maintains its full operational activities and processes after a business disaster.   After the business disaster, the entity may even grow bigger, because it has identified critical functions and their dependencies for continued growth.  While the period is a time of recovery, for business entities that are well-prepared, the recovery period offers a unique opportunity for innovation and rapid recovery and development on all fours: organization, processes, people, and performance.

8 0
2 years ago
Read 2 more answers
What is the boundary folding method?
Romashka [77]

Answer:

 Boundary folding method is basically used in the java algorithm and in the hash table. In the hash function, the left and the right value are basically folded in the fixed boundary between the given center values by using the boundary folding methods.

There are basically two types of folding method in the hashing that are:

  • Folding shift
  • Folding boundary

In the folding boundary method the outside value are get reversed and the alternate values are get flipped at the boundary folding method.

4 0
3 years ago
17.
Radda [10]
Sorry to answer you so late but that would be truth because that is the first rule of science which is what thermodynamics depends in. 

The first law of thermodynamics is a type of law of conservation but with thermodynamics systems. 


So, in gogle I found this: "The law of conservation of energy states that the total energy of an isolated system is constant; energy can be transformed from one form to another, but cannot be created or destroyed."

Like I said, sorry to reply so late but I hope this helped! =)
3 0
3 years ago
The unthinkable happens and disaster strikes, crippling your network. You implement your disaster plan, but it doesn't go smooth
Degger [83]

Answer:

Post-mortem.

Explanation:

It refer to the discussion or analysis of event like here disaster why it doesn't work like plan based and through whole discussions what we learn so in future avoid such type of issue or mistakes.

7 0
3 years ago
Well this isn't school related, but how do i watch dubbed and subbed anime for free on my computer?
Shtirlitz [24]
Crunchyroll or my anime list. Both of these work.

Hope this helps you

3 0
3 years ago
Read 2 more answers
Other questions:
  • The project started the development of inter-network connections using tcp/ip that has evolved into the internet today.
    5·1 answer
  • Which of the following is a list of input devices?
    13·2 answers
  • What are the different components of the cloud architecture?
    5·2 answers
  • Which of the following is a benefit, as well as a risk, associated with peer-to-peer networks?
    6·2 answers
  • What are the top ten alternative songs of the 2000's?
    7·1 answer
  • Which of the following is a hardware component used to hold the BitLocker encryption key and ensures encrypted data is not acces
    5·1 answer
  • What output is produced by
    10·1 answer
  • What does the Python print() function do?
    7·1 answer
  • On a rheostat the first terminal is connected to a
    14·1 answer
  • Please someone do this for me and send a screenshot i really need it for my exams pleaseeee :(<br>​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!