package explore;

import java.util.Scanner;

/*
 * Demonstrates selection (the "if" statement).
 * @author Michael Jenkin and Hamzeh Roumani
 * @version 0.1
 * @since Fall 2014
 */
public class App5
{
	public static void main(String[] args)
	{
		int n = 12;
		int m = 8;
		
		// the basic if statement
		if (n > m)
		{
			System.out.println(n + " is bigger than " + m);
		}
		
		// same logic using a boolean variable	
		boolean bigger = (n > m);		
		if (bigger)
		{
			System.out.println(n + " is bigger than " + m);
		}

		// let k be the smaller of m and n
		int k;
		if (m < n)
		{
			k = m;
		}
		else
		{
			k = n;
		}
		System.out.println("The smaller of the two is: " + k);
		
		// compounded condition
		Scanner input = new Scanner(System.in);
		System.out.print("Enter any integer ... ");
		int number = input.nextInt();
		if (number % 2 == 0 && number % 5 == 0)
		{
			System.out.println(number + " is divisible by both 2 and 5");
		}
		else if (number % 2 == 0)
		{
			System.out.println(number + " is even but not divisible by 5");
		}
		else if (number % 5 == 0)
		{
			System.out.println(number + " is odd and divisible by 5");
		}
		else
		{
			System.out.println(number + " is not divisible by 2 nor 5");
		}
			
	}
}