Howdy. Attendance today is on paper, I gave you the cards. 

In the beginning I asked you to start DrRacket. Can you do it again? 

Start it then copy this in the definitions area: 

http://silo.cs.indiana.edu:8346/c212/spr2015/tetris.rkt

I propose this as the project. I need to know: yes or no. 

So on card write your name and your position, including explanations, if any. 

Load the code, run it, ask yourself: can I write this in Java? 

How about this code, which is written in Java?

http://silo.cs.indiana.edu:8346/fall2012/c212/final/Drawing.java.phps

I try to download DrJava but sourceforge is not available. 

So instead I copy the code in a file Something.java in Notepad. 

I then save the file on the desktop. Inside cmd:

  cd \
  cd Users
  cd dgerman
  cd Desktop
  PATH=%PATH%;"C:\Program Files\Java\jdk1.8.0_05\bin"PATH=%PATH%;"C:\Program Files\Java\jdk1.8.0_05\bin"
  javac Something.java
  java Two 6

Can you write something like this? How do you do it? 

Let's now turn our attention to the following document: 

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

Next let's try to implement this story in Java:

  1. A Cow is a Creature. A Dolphin is a Creature. A Fish is a Creature. 
     A Bass is a Fish. Cows live 15 years. Dolphins live 20 years. Bass 
     lives 16 years. A Guppy is a Fish. Guppies live 2 years. 

  2. Anthony's Pets has an array of creatures on display in the mall. The 
     array is composed of a cow, a dolphin, a bass and a guppy.

Please write the above story in Java. 

In lecture we implemented the first part of the story as follows: 

class Creature {
    
}

class Cow extends Creature {
    int howLong() {
        return 15;    
    }
}

class Dolphin extends Creature {
    int howLong() {
        return 20;
    }
}

class Fish extends Creature {
    
}

class Guppy extends Fish {
    int howLong() {
        return 2;
    }
}

class Bass extends Fish {
    int howLong() {
        return 16;
    }  
}

Is there anything wrong with this code? 

Is there anything wrong with our modeling?