Engineering
11.01.2023 10:18
243
452
6
Solved by an expert

6.17 (Even or Odd) Write a method isEven that uses the remainder operator (%) to

6.17 (Even or Odd) Write a method isEven that uses the remainder operator (%) to determine whether an integer is even. The method should take an integer argument and return true if the integer is even and false otherwise. Incorporate this method into an application that inputs a sequence of integers (one at a time) and determines whether each is even or odd.
Show Answers
celestemaria0727
celestemaria0727
4,6(90 marks)

The % divides a number and returns the remainder.

To determine if it's an even or odd number, do num%2

if num%2 == 0, then it's an even number because the number is divisible by 2, hence returned no remainder.

if num%2 != 0, then it's an odd number.

I don't use java so I don't know how to write it in Java, but in C it would look something like this:

int even_odd(int num){

  if(num%2 == 0) return 1;

  else                  return 0;

}

jesusdelao
jesusdelao
5,0(93 marks)

Shelly and Brooke can be made to reconcile using the skills of the 4ds.

Explanation:

Using the 4Ds of a Difficult Conversation (Define, Defuse, Discuss, and Decide) is paramount in this discussion.

The real reason is that they are not able to deal with the inclusion of Evans in their dynamic.

So they must acknowledge this fact at first and it would come as the process of being able to define.

Then they must be able to diffuse tension by acknowledging that the presence of Evans is not what is the core of the problem to diffuse the situation.

Then they will discuss what they can do best to curb the communication gap.

Then finally they will decide on the course to take

Popular Questions about the subject: Engineering

What portion of the bit is used to guide the counterbore into a...
Engineering
20.08.2021 11:36
at a eutectic point on a binary temperature-composition phase diagram,...
Engineering
25.08.2020 16:16
Technician A says that tightening a micrometer can damage the micrometer....
Engineering
25.12.2021 13:45
Which statement is not true regarding motherboards?...
Engineering
17.11.2020 11:56
Ow does the study of robotics benefit from a mechanical engineering...
Engineering
21.11.2020 11:25
Which two great lakes are connected by the straits of mackinac...
Engineering
23.01.2020 22:24

New questions by subject

Find the area of rectangle B...
Mathematics
17.03.2023 18:46
Fill in the blanks: After the horrors of conflict during World...
History
20.04.2020 12:26
Find the value of x. Give reasons to justify your solution. D∈A...
Mathematics
20.01.2020 17:22
1) Draw any two English alphabets having an only a vertical line...
Mathematics
19.05.2023 12:42
I need help with this question. welp plz explain with detail and...
Mathematics
11.02.2020 22:19
Pls help fast i have to submit...
History
17.03.2023 10:13
#
#
#
#
# #

We expand our knowledge with many expert answers