answer-4.html - on 4 Write a Java program to check a number...

This preview shows page 1 - 3 out of 3 pages.

on 4. Write a Java program to check a number received from users. Tell if the number is an even or odd number in the output. See example output below. (8 pts) Examples: -GRASP exec: java Evenodd Please enter an integer: 11 11 is an odd number. -jGRASP: operation complete. Or ---GRASP exec: java Evenodd Please enter an integer: 64 64 is an even number. --; GRASP: operation complete. Requirements: a) Use int type for user input. b) Use remainder (%) operation to decide even or odd numbers. An even number is divisible by 2, while an odd number is not, with a remainder of 1. c) Use conditional statement (if) d) Your class should be named EvenOdd, and your source code file should be named EvenOdd.java. e) Comments, programming style, compiling and executing, and submission requirements are the same like those in HW1. Show transcribed image text 4. Write a Java program to check a number received from users. Tell if the number is an even or odd number in the output. See example output below. (8 pts) Examples: -GRASP exec: java Evenodd Please enter an integer: 11 11 is an odd number. -jGRASP: operation complete. Or

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture