1. Nobody complained or opposed to using the time between lecture and lab for exam. 

2. Everybody starts the written exam at 11:30am and goes up to 2:15pm. 

   You can stop earlier. Once you stop your written exam is over. 

   Once your written exam is over you can't write on it any more. 

3. Your practical part of the exam starts after 15 minutes. 

   During those 15 minutes the written exam must be with the instructor (dgerman). 

4. Once you start the practical you are expected to type the written exam in first. 

   Type exactly as written. Then fix it along the lines of what you wrote. 

   The typing without fixing must be finished by 3:30pm and written exams returned. 

   The fixing can go on until midnight when OnCourse will close (at 2am). 

   You need to include self-assessment for the written exam (raw score). 

The questions on the exam: 

(a), (b) will come from 

https://www.cs.indiana.edu/classes/c212-dgerman/spr2015/lab13.html

(c), (d) will be like: 

          (c) make stage three keep score

          (d) fix stage three so tetrominoes are confined to the game space 

          I can also ask you to sort things.  

The Project: 

  -- Phoebe will switch today from rotation to ghost blocks in lab

  -- http://silo.cs.indiana.edu:8346/c212/sum2015/lastminutehelp.phps

Today: 

  1  Let's fill an ArrayList with integers, randomly chosen from 10 to 30. 

  1' Please sort the array using Comparable such that odd numbers come first. 

  2  Please sort the array using Comparator such that odd numbers come first,
     in ascending order and even numbers come after, in descending order. 

  3  Make stage three keep score. 

  4  Confine tetrominoes to game space in stage three. 

  5  Create a new multimino (three, five, six or seven blocks). 

After intense negotiations I agreed to do 4 so either Jon or Mark or someone else 
can do 1'. Now I finished 4 and I need some help from someone to do 1' as promised. 

import java.util.*; 

class Number extends Integer implements Comparable<Number> {
  public int compareTo(Number other) {
    if (this % 2 == 0) 
      if (other % 2 == 0)
        return 0;
      else if (other % 2 == 1)
        return 1;
    else // this is odd 
      if (other % 2 == 0) 
        return -1;
      else // other also odd
        return 0; 
  }
}

This is great just not allowed. 

import java.util.*; 

class Number implements Comparable<Number> {
  Integer value; 
  Number(Integer value) {
    this.value = value;  
  }
  public String toString() {
    return this.value + ""; 
  }
  public int compareTo(Number other) {
    if (this.value % 2 == 0) { // this is even 
      if (other.value % 2 == 0) { // other is even too 
        return 0; // so order does not matter 
      } else { // other is odd 
        return 1; 
      }
    } else { // this is odd
      if (other.value % 2 == 1) { // other is odd  
        return 0; // order does not matter 
      } else { // other is even 
        return -1;
      } 
    }
  }
}

import java.util.*; 

class One {
  public static void main(String[] args) {
    ArrayList<Number> a = new ArrayList<Number>(); 
    a.add(new Number(4)); 
    a.add(new Number(6)); 
    a.add(new Number(2)); 
    a.add(new Number(8)); 
    a.add(new Number(3)); 
    a.add(new Number(5)); 
    a.add(new Number(1)); 
    a.add(new Number(7)); 
    System.out.println( a ); 
    Collections.sort(a); 
    System.out.println( a ); 
  }
}

If you run this you get

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run One
[4, 6, 2, 8, 3, 5, 1, 7]
[3, 5, 1, 7, 4, 6, 2, 8]


See you later I am going in LH204. 

--