Java Lesson 9 - Booleans
Videos |
|
Text |
|
READ text then COMPLETE assignments below.
Assignments
|
|
Lesson 9 Exercises
Download Exercises for Lesson 8 below and submit it when done
bp_lesson_9_ex
Even Or Odd
Create a new project called EvenOrOdd containing a class called Tester. In the main method of
Tester print a prompt that says, “Enter an integer:” Input the user’s response from the keyboard,
test the integer to see if it is even or odd (use the modulus operator % to do this), and then print
the result as shown below (several runs are shown).
Tester print a prompt that says, “Enter an integer:” Input the user’s response from the keyboard,
test the integer to see if it is even or odd (use the modulus operator % to do this), and then print
the result as shown below (several runs are shown).
Enter an integer: 28
The integer 28 is even.
Enter an integer: 2049
The integer 2049 is odd.
Enter an integer: -236
The integer -236 is even.