Assignment 35, Else and If

Code

   ///Name: Stella Koliavas
   ///Period: 5
   ///Program Name: Else and If
   ///File Name: ElseandIf.java
   ///Date Finshed: 10/26/15

   public class ElseandIf
   {
    public static void main(String [] args)
    {
        int people = 30;
        int cars = 40;
        int buses = 15;
        
        if(cars > people)
        {
            System.out.println("We should take cars.");
        }
        else if (cars < people)
        {
            System.out.println("We shouldn't take cars.");
        }
        else
        {
            System.out.println("We can't decide.");
        }
        
        
        if( buses > cars)
        {
            System.out.println("That's too many buses.");
        }
        else if( buses < cars )
        {
            System.out.println("We still can't decide because we're stupid af.");
        }
        
        
        if(people > buses)
        {
            System.out.println("let's take the damn buses.");
        }
        else
        {
            System.out.println("Let's stay home because we're too stupid to call Ubers there.");
        }
     }
   }

   ///else if is saying if its not the prior if print this statement while else is saying if its not any of the 
   above options print this

   /// the else if is printed if another statement above it doesn't start with else if and instead if. The else if 
   signifies to the else that it doesn't need to print if one of the first commands
            
        
        
        
        
    

Picture of the output

Assignment 35