AllTheTimeWorld.com

alice booleanThe seagull asks how many penguins there are.

The seagull asks how many penguins there are.

See if you can add to this project

The seagull asks how many penguins there are.

See if you can add to this project


Text of video

Code:

public void myFirstMethod() {
     // Programmer : Janet Joy
     // How many penguins?
     Integer answer = this.seagull.getIntegerFromUser( "How many penguins do you see?" );
     if( 3 == answer ) {
          this.seagull.say( "Yes, that's right! I'm not a penguin." );
     } else { 
          if( answer == 4 ) { 
               this.seagull.say( "No way! I'm NOT a penguin!" );
		  } else { 
		        this.seagull.say( "I've no idea where you got that answer!" );
         }    
     } 
}

Download this project

My code doesn't look like that!