Any questions about the Homework? 

Let's work on the minute paper. 

Let's talk the Early Evaluation Exam: Study Guide next week. 

Then a question for Brian. 

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) ); 
  } 
}

Can you write this program without an if statement? 

Brian says: loophole. 

That means: 

  System.out.println( n > m ? n : m ); 

Blake:

  Math.abs(n - m) / 2.0 + (n + m) / 2.0

  Math.abs(n - m) / 2 + (n + m) / 2

  (Math.abs(n - m) + (n + m)) / 2

Let's discuss DrJava

http://drjava.sourceforge.net/

4.53 * 100  

4.35 * 100

Welcome to DrJava.  Working directory is C:\Users\dgerman
> 4.53 * 100
453.0
> 4.35 * 100
434.99999999999994


Why is that: limited (finite) precision. We need to be careful. 

Next we do the exercises on the front of the minute paper.

Taylor wrote: 

if (cond1 == false){

} else { 

  if (cond2 == false) {
    stat2;
  } else {
    stat1;
  } 

}

Look at it this way: 

if (cond1){ 

  if (cond2 == false) {
    stat2;
  } else {
    stat1;
  } 

} else {


}

More: 

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

Austin types:

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

  }     
} else {
  stat2; 
}  

Can you simplify this one? 

Look at the notes from this morning. 

--