Howdy. 

The third exam is next Wednesday. We will start preparing this week.

Homework 07 has been posted, including a prototype. 

There is a help with Homework 06. I received some questions.

Suppose that the circle has vx, vy, x, y. 

When I move:

this.x += this.vx;

this.y += this.vy; 

Who modifies the this.vx and this.vy? 

The user through the key events. 

Who modifies this.x and this.y? 

The teh() method does, as shown above. 

When I get a new value for this.x or this.y I want to stay in the frame. 

this.x = (this.x > 400) ? (this.x - 400) : (this.x < 0) ? (400 + this.x) : x;

Let's see the prototype for Homework 07. 

What about the exam next week? 

In lab this week we will have a mini-mock-up. 

Your attendance will be how well you do. 

There are nine problems and exam says three random problems per person. 

  1. Shortest program that reacts to mouse events. 

  2. Shortest program that reacts to mouse motion events. 

  3. Shortest program that reacts to key events. 

  4. Shortest program that keeps time. 

  5. Shortest program that draws graphics. 

  6. Shortest program that handles an Exception. 

  7. Shortest program that sorts using Comparables. 

  8. Shortest program that sets up a GUI. 

  9. Shortest program that sorts with Comparators. 

 10. What about sound? 

Today: Exceptions, Comparators. 

import java.util.*;

public class Six {
  public static void main(String[] args) {
    Scanner a = new Scanner(System.in); 
    System.out.print("Integer: "); 
    String input = a.nextLine(); 
    try { 
      int number = Integer.parseInt( input ); 
      System.out.println( Math.sqrt( number ) ); 
    } catch (Exception e) {
      System.out.println( "Oops." ); 
    }

  }
}

Question: 

What is a good project that you would enjoy working on? 

http://silo.cs.indiana.edu:8346/c212/fall2015/third/05.phps

Attendance: 

Seth Law, Ross Richardson, Jacob Teed, Caleb Donoho, Elissa Booras, Mange Chen, Jacob Adley, Miguel Palabrica, 
Tyler Carlson, Tristen Sizemore, Ryan Hartford, Kyle Palmer, Nanjie Chen, Sam Pilgrim, Manasse Kwete, Esteban Guevarra, 
Lin Jiang, Adel Beitvashahi, Hasan Ahmed, Dian Zhi, Christopher Audretsch, Jason Lam, Young Ho Yoo, Jackson Stanton, Ben Stahl, 
Andrew Timothy, Vinoth Aryan, Yaodong Chen, Yubang Ou, Nick Konich, Tom Mackey, Ruifeng Zheng, Ziwei Zhou, Yutong Lu, Hyung Man Bae,
Shengnan Ma, Eduardo Vidaurri-Rodriguez, Kaitlyn Gubert, Michael Herron, Cheng Jiang, Wenhao An, Jing Chen, Marc Botts, Tim Jones, 

--