Assume the following program: 

import java.util.*;

public class Example {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in); 
    int n, m; 
    System.out.print("Type an integer value: ");
    n = scanner.nextInt(); 
    System.out.print("Type another integer value: ");
    m = scanner.nextInt(); 
    System.out.print("The largest of (" + n + ", " + m + ") is "); 
    System.out.println( Math.max(n, m) ); 
  } 
}

We discussed it and it evolved to this:

import java.util.*;

public class Example {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n, m;
    System.out.print("Type an integer value: ");
    n = scanner.nextInt();
    System.out.print("Type another integer value: ");
    m = scanner.nextInt();
    System.out.print("The largest of (" + n + ", " + m + ") is ");
    System.out.println( Math.max(n, m) );

    int maximum; // local variable 
    if (n > m) 
      maximum = n;
    else 
      maximum = m; 

    System.out.print("The largest of (" + n + ", " + m + ") is ");
    System.out.println(maximum);    

    maximum = ((n + m) + Math.abs(n - m)) / 2;

    System.out.print("The largest of (" + n + ", " + m + ") is ");
    System.out.println(maximum);    
  }
}

So we need if statements. 

We worked on the minute paper exercises. 

The snippets were easy. 

&& vs || is like * vs. + when we don't have parens. 

Some operators have precedence over others.

Now with respect to the flowcharts. 

Audrey types:

if (cond1)
{
  if(cond2)
  {
    Stat1;
  }
  else
  {
    Stat2;
  }
}
else
{

}

That's good. 

Can we eliminate curly braces (as many as we possibly can)? 

Simplification:

if (cond1)
  if(cond2)
    Stat1;
  else
    Stat2;

Nice. 

Now Jace works on the second one:

if (cond1)
{
  if(cond2)
  {
    stat1;
  }
  else
  {

  }
}
else
{
  stat2;
}

Good. 

Let's try to simplify this also. 

Simplifying this we get:

if (cond1)
{
  if(cond2)
    stat1;
}
else
  stat2;

Are we done? 

If we removed { }'s further we'd get:

if (cond1)
  if(cond2)
    stat1;
else
  stat2

Is this the same as:

if (cond1)
  if(cond2)
    stat1;
  else
    stat2

Yes it is. 

And that proves removing would be wrong.

Because the flow charts are not the same, right?

--