On the Final Exam you will write programs. Like in Exam 02. 

(Like in Exam 03 too, but specific problem not known ahead of time.)

Chapter  1: Introduction
Chapter  2: Using Objects (no graphics or GUIs) 
Chapter  3: Implementing Classes (no graphics or GUIs) 
Chapter  4: Fundamental Data Types
Chapter  5: Decisions
Chapter  6: Loops
Chapter  7: Arrays and Array Lists
Chapter  8: Designing Classes
Chapter  9: Inheritance
Chapter 10: Interfaces
Chapter 11: I/O and Exception Handling
Chapter 12: Object-Oriented Design
Chapter 13: Recursion
Chapter 14: Sorting and Searching
Chapter 15: The Java Collections Framework
Chapter 16: Basic Data Structures
Chapter 17: Tree Structures
Chapter 18: Generic Classes
Chapter 19: Stream Processing

Problems can come from the above chapters. 

You can use what you wrote in TH1 and TH2 during the exam if you think it's useful. 

Fri Jul 06 https://www.tutorialspoint.com/junit/index.htm

Textbook Chapter 8 pp. 405-406 

http://www.horstmann.com/bigjava.html

http://www.horstmann.com/bigj6/bookcode_bjeo_6.zip

http://silo.cs.indiana.edu:8346/c212/milestones/ch08/section_7/

I'll email you tonight. I can make the lecture/lab tomorrow from your questions. 

I'd like to know what you did before I show you where you're wrong or what else to do. 

Homework 11 stays as is. 

It's about a BST. 

Chapter 17 has the answer. 

Yawen Jiaxing Mary    Santiago Jay    Ryan   Runxia Bakr
Zejun Rui     Jingyun Matthew  Serena Andrew Kevin  dgerman

What does this do? 

public class BST<T extends Comparable<T>> {
  private Node<T> root;
  public BST() {
    this.root = null;
  }
  public BST(Node<T> node) {
    this.root = node;
  }
  public BST(T value) {
    this.root = new Node<T>(value);
  }
  public void insert(T value) {
    if (this.root == null)
      this.root = new Node<T>(value);
    else if (this.root.value().compareTo(value) > 0)
      this.root.left.insert(value);
    else if (this.root.value().compareTo(value) < 0)
      this.root.right.insert(value);
  }
  public String print() {
    if (this.root == null) return "()";
    else return "(" + this.root.print() + ")";
  }
  public String toString() {
    return this.root == null ? "" : this.root + "";
  }
  public static void main(String[] args) {
    BST<Integer> bst = new BST<Integer>();     
    System.out.println(
    "                                            toString: " + 
                       bst + "\nprint: " + bst.print()); 
    bst.insert(3); 
    System.out.println(
    "                                            toString: " + 
                       bst + "\nprint: " + bst.print()); 
    bst.insert(1); 
    System.out.println(
    "                                            toString: " + 
                       bst + "\nprint: " + bst.print()); 
    bst.insert(2); 
    System.out.println(
    "                                            toString: " + 
                       bst + "\nprint: " + bst.print());   
    bst.insert(6); 
    System.out.println(
    "                                            toString: " + 
                       bst + "\nprint: " + bst.print()); 
    bst.insert(4); 
    System.out.println(
    "                                            toString: " + 
                       bst + "\nprint: " + bst.print());
  }
}

class Node<T extends Comparable<T>> {
  T value;
  BST<T> left, right;
  public Node(T value) {
    this.value = value;
    this.left = new BST<T>();
    this.right = new BST<T>();
  }
  public String toString() {
    return this.left + " " + this.value + " " + this.right;
  }
  public T value() {
    return this.value;
  }
  public String print() {
    return this.value + " " + this.left.print() + " " + this.right.print();
  }
}

What does the code in 17.3 teach us? 

http://silo.cs.indiana.edu:8346/spr2012/04242012/one.phps

What does the link above refer to? 

http://silo.cs.indiana.edu:8346/h212/spr2016/0420a.phps

What about this other one? 

--

public class Pair {
  private int first;
  private int second; 
  public Pair(int a, int b) {
    this.first = a; 
    this.second = b;
  }
  public int first() {
    return this.first;  
  }
  public int second() {
    return this.second;  
  }
  public String toString() {
    return "(" + this.first + ", " + this.second() + ")"; 
  }
}

--

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> Pair a = new Pair(3, 5)
> a
(3, 5)


--

public class Pair<T, S> {
  private T first; // see page 826 in the text
  private S second; 
  public Pair(T a, S b) {
    this.first = a; 
    this.second = b;
  }
  public T first() {
    return this.first;  
  }
  public S second() {
    return this.second;  
  }
  public String toString() {
    return "(" + this.first + ", " + this.second() + ")"; 
  }
}

--

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> Pair<String, String> a = new Pair<String, String>("a", "b")
> a
(a, b)
> Pair<Integer, Integer> b = new Pair<Integer, Integer>(3, 5)
> b
(3, 5)


--

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> Pair<String, Integer> a = new Pair<String, Integer>("Michael Jordan", 1963);
> a
(Michael Jordan, 1963)


--

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> Pair<String, Integer> a = new Pair<String, Integer>("Michael Jordan", 1963);
> a
(Michael Jordan, 1963)
> Pair<Pair<String, Integer>, String> t1 = new Pair<Pair<String, Integer>, String>(a, "net worth: 1.65 billion usd");
> t1
((Michael Jordan, 1963), net worth: 1.65 billion usd)
> Pair<Pair<String, Integer>, String> t2 = new Pair<Pair<String, Integer>, String>(new Pair<String, Integer>("Larry Bird", 1955), "I've got a theory that if you give 100 percent all of the time, somehow things will work out in the end.");
> t1
((Michael Jordan, 1963), net worth: 1.65 billion usd)
> t2
((Larry Bird, 1955), I've got a theory that if you give 100 percent all of the time, somehow things will work out in the end.)


--

If you don't read the chapters 18, 19 your TH2 will be a disaster. 

http://silo.cs.indiana.edu:8346/c212/milestones/ch18/worked_example_1/

--

On the Final: up to three problems from chapters indicated.

--