Actions Problems

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14

Math Actions: IsEven

For this problem, add an IsEven action with one integer parameter and a boolean return value for this problem. Use mod to determine if the parameter is even or odd. If the parameter is even, return true and if it's odd, return false.

Once you have completed the action, call the action with the argument 1902(e.g., booleanResult = IsEven(1902)). Then, output the result. When run, the program should output the following.

-6
-2
15
17.0
true

Coding:

Blocks

PreviousNext