class LabTwo {
  public static void main(String[] args) {
    {
      boolean b = true;
      int x = 0; 
      System.out.println( (!b || (x == 0)) + " is true "); // true  
    }

    // Simplify b == true when b is a boolean variable. 
    // 
    // To simplify means to say the same thing with fewer resources. 
    // 
    //   
    //         Expression              Simplification 
    // 
    //  b   |  b == true               b 
    // -----+---------------------------------------------- 
    // true | true                     true 
    // false| false                    false 
    // 
    // This shows the two expressions are equivalent (same values for same inputs). 

    {
      boolean b = true; 
      System.out.println( b == (b == true) + " is true " ); 
      b = false; 
      System.out.println( b == (b == true) + " is true " ); 
    } 

    // Let's simplify now (x < 5) && (x < 25) if x is an int variable.

    // Answer: x < 5 this seems to be the answer (see below) 
 
    // Another answer: x < 25 that seems to not be the answer  

    //   x                             5             25 
    //  ----------------------------------------------------------------
    //   x < 5               T T T T   F    F F F    F    F F F F 
    //  ----------------------------------------------------------------
    //   x < 25              T T T T   T    T T T    F    F F F F 
    //  ----------------------------------------------------------------
    //   x < 5 && x < 25     T T T T   F    F F F    F    F F F F 


    {
      boolean b = false;
      System.out.println( b ); 
    }

    // (x > 3) && (x < 5)
    // 
    // x       |        3  4  5  
    // --------+--------------------
    // x > 3   |   F F  F  T  T  T T 
    // x < 5   |   T T  T  T  F  F F 
//-----------------------------------------
// x>3 && x<5  |   F F  F  T  F  F F 
//-----------------------------------------
//    x == 4   |   F F  F  T  F  F F 

     // b = (n == 0) gets rid of an if statement that becomes unnecessary
     // also an expression could be false always such as: (x < 3) && (x > 5)
  }
}


class LabTwo {
  public static void main(String[] args) {
    int n = 0; // if n is 1 "You will not make it."
               // if n is 0 "You will make it." 
    System.out.println( 
       "You will " + 
       " not ".substring(5 - 4 * n) +      
       "make it."                 
                       );
    // this is step 1. now convert the test into 0 or 1.
  }
}

class LabTwo {
  public static void main(String[] args) {

    int n; // set n to 1 or 0 depending on whether you won't or will make it 
    
    double efficiency = 50, // miles per gallon
           fuel = 1.2, // gallons 
           distance = 61; // miles
    
    double goal = distance - (efficiency * fuel); 
    
    // if goal >= 0 then n should be 1 because I can't cover the distance 
    
    n = (int) (Math.round ( (goal + Math.abs(goal)) / (2 * goal) ) ); 

    // System.out.println( n ); 
    
    System.out.println( 
       "You will " + 
       " not ".substring(5 - 4 * n) +      
       "make it."                 
                       );
  }
}