
class Jan18 {

   /* Reviewed primitive types and their sizes. */

   /* Reviewed arithmetic operators:
        + addition
        - subtraction
        * multiplication
        / division

        Remember with division, if both operands are integers the fractional part
        of the result is truncated.

        If either of the operands is a floating point value, the result is a
        floating point value.
   */

   /*   % modulus

        a % b evaluates to the remainder after a is divided by b.

        Modulus is useful to determine if an integer is odd or even or if an integer
        is divisible by another integer.
   */

   /*   == equivalent operators

        a == b is either true or false - a Boolean expression

        We can use Boolean expressions in conditional statements

        if (Boolean expression) {     // if Boolean expression is true
            // do this
        }
        else {                        // if Boolean expression is false
            // do that
        }

   */

   import java.util.Scanner;

   public static void main(String[] args) {

        Scanner kb = new Scanner(System.in);

        // Determine if a value is odd or even

        System.out.println("Please enter an integer");
        int value = kb.nextInt();

        if (value % 2 == 0) {
            System.out.println(value + " is even");
        }
        else {
            System.out.println(value + " is odd");
        }

        // Determine if value is divisible by 5

        System.out.println("Please enter an integer");
        int input = kb.nextInt();

        if (input % 5 == 0) {
            System.out.println(input + " is divisible by 5");
        }
        else {
            System.out.println(input + " is not divisible by 5");
        }
   }
}