Notes to OOP features of the Jeroo language
Object oriented programming defines objects
- Each Jeroo you create is an _______________.
- an object has ________________
- For example a Jeroo has:
_____________
,
______________
, ______________
- an object has _________________ (things it can do)
Classes = definitions of objects
When you create a new object it is _______________________.
An object may be constructed a number of different ways.
A class describes 3 things:
- What kind of ____________ is in an object
- How to make a ___ object of that class (constructor)
- Try this Example: Dim Quentin as Jeroo = new Jeroo(10,7,EAST,1)
- Holding ____ flower/s
- Location = row ____, column ____
- Direction = ___________
- The default constructor creates a Jeroo at location ________ facing ___________ with ____ flowers
- Dim Andy as Jeroo = new Jeroo()
- The _____________ of an object (the actions it can perform)
- Example: Andy.hop()
- Jeroos can hop, pick flowers, plant flowers, toss nets, and turn.
Syntax is important!
- Dim Andy as Jeroo = new Jeroo(2,5,SOUTH,3);
- Andy is an _____________ , Jeroo is the ________________
Sending messages to objects
We don't perform operations on objects, we “talk” to them
This is called __________________________________to the object
A message looks like this:
- object . method ( extra information )
- The __________ is the thing we are talking to
- The ____________ is a name of the action we want the object to take
- The ___________________ is anything required by the method in order to do its job. (parameter)
Messages and methods
- ______ an object some information
- ______ an object to do something
- ______ an object for information (usually about itself)
- Any and all combinations of the above
Using OOP syntax: Rewrite the following English statements as object oriented messages
- Tell the woman named Clarissa to walk 2 steps ____________________________
- Tell the Jeroo named Alan to turn to the right ______________________________
Vocabulary Review (watch out! the order is mixed up!)
- _________: something that you “say” to an object, either telling it something or asking it for information
- _________: an instance, or member, of a class
- _________: the type, or description, of an object
- _________: extra information sometimes needed when sending a message.
- _________: a way to create an object. comes as part of the class definition.