![]() Provide a parameter value and see what happens. setDirection method:int direction indicates method requires 1 integer parameter to run From Introduction to Programming with Greenfoot by Michael Kölling Used with permissionįrom Introduction to Programming with Greenfoot by Michael Kölling Used with permission Exercise 1.5 Invoke the setDirection(int direction) method.One or more parameters – additional information required to run.Empty – needs no additional information to run.Parentheses hold the parameter list – additional information to run.Can you create a situation in which the result of this method is not zero? (In other words: can you make your wombat eat some leaves?) Does it always return true? Or can you find situations in which it returns false?įrom Introduction to Programming with Greenfoot by Michael Kölling Used with permission Exercise 1.4 Using a newly created wombat, the getLeavesEaten() method will always return zero. ![]() boolean – true or false From Introduction to Programming with Greenfoot by Michael Kölling Used with permissionįrom Introduction to Programming with Greenfoot by Michael Kölling Used with permission Exercise 1.3 Invoke the canMove() method on your wombat.Any other word indicates information that is returned.void returns nothing – completes task and stops.Return type indicates what the method returns to us.Place two wombats in your world and make them face each other. Invoke a method by selecting it from the menu From Introduction to Programming with Greenfoot by Michael Kölling Used with permissionįrom Introduction to Programming with Greenfoot by Michael Kölling Used with permission Exercise 1.2 Invoke the move() method on a wombat.Interact with objects by right-clicking them.From Introduction to Programming with Greenfoot by Michael Kölling Used with permissionįrom Introduction to Programming with Greenfoot by Michael Kölling Used with permission Exercise 1.1 Create some more wombats in the world. New Wombat objects can becreated by selecting the new option.Right-click on the Wombat class to see class menu.Wombat (Australian marsupial) class describes all wombats.The execution controls (the Act, Run and Reset buttons and the speed slider) From Introduction to Programming with Greenfoot by Michael Kölling Used with permission.The world (the largest area covering most of the screen.Greenfoot Chapter 1Getting to know Greenfoot From Introduction to Programming with Greenfoot by Michael Kölling Used with permission
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |