Question: Java Script 6.17 (Even or Odd) Write a method isEven that uses the remainder operator (%) to determine whether an integer is even. The method

Java Script

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.

SAMPLE RUN #4:java EvenOrOdd

Enteranumber:0

0iseven

Enterytoplayagain,ntoquit(y/n):y

?Enteranumber:1 1isodd

Enterytoplayagain,ntoquit(y/n):y

?Enteranumber:-3 -3isodd

Enterytoplayagain,ntoquit(y/n):y

?Enteranumber:-111

-111isodd

Enterytoplayagain,ntoquit(y/n):y

?Enteranumber:-113

-113isodd

Enterytoplayagain,ntoquit(y/n):y

?Enteranumber:-115

-115isodd

Enterytoplayagain,ntoquit(y/n):y

?Enteranumber:-118 -118iseven

Enterytoplayagain,ntoquit(y/n):y

?Enteranumber:202

202iseven

Enterytoplayagain,ntoquit(y/n):y

?Enteranumber:7 7isodd

Enterytoplayagain,ntoquit(y/n):n

?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!