Prog35: Else and If

///Name: Ilana Levy
///Period: 5
///Program Name: Else and If
///File Name: elseIf.java
///Date finished: 9/9/2015

import java.util.Scanner;

public class elseIf
{
        public static void main( String[] args )
        {
                int people = 30;
                int cars = 40;
                int buses = 15;
                
                if ( cars > people )
                {
                        System.out.println( "We should take the cars." );
                }
                if ( cars < people )
                {
                        System.out.println( "We should not take the cars." );
                }
                else 
                {
                        System.out.println( "We can't decide." );
                }
                
                
                if ( buses > cars )
                {
                        System.out.println( "That's too many buses." );
                }
                if ( buses < cars ) 
                {
                        System.out.println( "Maybe we could take the buses." );
                }
                else 
                {
                        System.out.println( "Fine, let's stay home then." );
                }
        }
}

///If and else create a result to be printed for all possible scenarios. Else if creates a second, contrasting option from if and else encompasses every other potential input. Thus, the system always replies.
// removing the else makes no difference in this situation because the condition of having more cars still holds. However, the else statement is now tied to the if statment ( buses < cars ) instead of the one above it meaning that if the variable valuse changed so that buses > cars, both the if statement for that condition and the else statement would print. When the else if statement exists, the else statement would not print because it is only the third option if option onf (if) and option two (else if) don't print.