Presentation is loading. Please wait.

Presentation is loading. Please wait.

Test review. When? Monday 9/27 in class Know Greenfoot How many classes? Top-most classes? What does each button do? Lowest child class?

Similar presentations


Presentation on theme: "Test review. When? Monday 9/27 in class Know Greenfoot How many classes? Top-most classes? What does each button do? Lowest child class?"— Presentation transcript:

1 Test review

2 When? Monday 9/27 in class

3 Know Greenfoot How many classes? Top-most classes? What does each button do? Lowest child class?

4 Read code public class Crab extends Animal { public void act( ) { checkAtEdge( 12 ); randomTurn( ); eatWorm( ); checkKeyPress( ); move( ); } // end act() method Class name? Class parent? Method name? Method return type? Method calls? Method that contains information to be passed? Comment?

5 checkAtEdge( 12 );What is this? What info is sent TO the method? What TYPE of info?

6 import greenfoot:What is this? Library name Give an example of it’s use

7 Greenfoot.getRandomNumber( limit ); How would you get a random number in the range 0 - 1023? Write an if statement to do something 25% of the time.

8 If statements and greenfoot Write code to... Do something 45% of the time Check if the left cursor key is pressed Turn 17 degrees at the world edge Eat a worm, including the if statement

9 Bracket rules Follow class definitions, method definitions, if statements Always paired { }

10 Semi-colon rules Not placed where brackets are used (class and methods definitions, if statements) Everywhere ELSE

11 import greenfoot.*; // Kills aliens public class Halo extends Actor { public void act() { setLocation( 100, 200 ) ; if( getSize( ) < 10 ) { killAlien( ); } move( ); } public void killAlien( ) { eat( Alien.class ); } How many steps? How many methods defined? How many methods called?

12 Identify errors... public class void Animal extends Crab ( ) { public boolean act( ); { if ( x < 10 ) { move; }


Download ppt "Test review. When? Monday 9/27 in class Know Greenfoot How many classes? Top-most classes? What does each button do? Lowest child class?"

Similar presentations


Ads by Google