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 _______________.
A class describes 3 things:
- What kind of _______________ is in an object
- How to make a ______ object of that class (constructor)
- Try this Example: Jeroo quentin = new Jeroo(10,7,EAST,1)
- Holding ____ flower/s, Location = row ____, column ____, Direction = ________
- The default constructor creates a Jeroo at location ________ facing ___________ with ____ flowers
: Jeroo andy = 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!
Jeroo andy = new Jeroo(2,5,SOUTH,3); andy is an _________ , Jeroo is the _________
Sending messages to objects
We “talk” to objects to tell them what to do.
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 or methods are used to:
- ______ an object some information
- ______ an object to do something
- ______ an object for information (usually about itself)
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.