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
System software can be described as end-user software and is used to accomplish a variety of tasks.
irina [24]
Your answer is false :)

I hope this helps! :)
8 0
3 years ago
The class attribute a. can be applied to only one element in an HTML document b. determines the copy that will be displayed when
Nuetrik [128]

Answer:

The answer is likely C. "Can be used by CSS to apply the same formatting to more than one HTML element."

Explanation:

Given that the name of the attribute is "class," it sounds like the kind of code that would be applied to multiple elements intended to display something a specific way.

Qualification:

I've invested hours of my time into learning HTML, but I've never dealt with the "class" attribute. So, maybe take my answer as a grain of salt.

4 0
3 years ago
Which option describes wearable technology? A. the incorporation of technology into objects we use regularly B. rugged technolog
vichka [17]

The correct answer is

A.  the incorporation of technology into objects we use regularly

#Platogang

8 0
3 years ago
What type of virus was the "lloveyou" virus?<br> 1.Trojan<br> 2.Worm
Paul [167]

Answer:

2. Worm

Explanation:

8 0
3 years ago
Read 2 more answers
Which option would a computer engineer most likely create? A) a programming language to run a new software program B.) the part
Zolol [24]

pogram b

Explanation:

3 0
2 years ago
Other questions:
  • 3.
    13·1 answer
  • What allows multiple computers to join the same network
    11·1 answer
  • HELP AS SOON IS A UNIT TEST WILL GIVE BRAINLIEST
    9·2 answers
  • Which of the following statements regarding EFT is false? EFT still requires the endorsement of a check EFT allows payment to be
    11·1 answer
  • What are two constraints that continuous-media files have that conventional data files generally do not have?
    12·1 answer
  • What xDSL version provides a maximum throughput of 24 Mbps downstream and 3.3 Mbps upstream?
    9·1 answer
  • What is the largest value that can be represented by 6 binary digits? .
    5·1 answer
  • A human subject’s photographs show two catchlights in each eye that are unwanted by the photographer. What is the most likely ca
    12·1 answer
  • When you type in text in an image in a photo-editing software, where is it created?
    8·1 answer
  • the ghost adventures team uses a variety of tools and technology in investigations. which one is described as an adjustable freq
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!