Name that Nerd - PC\|MAC
OOP Syntax
Directions: Open the OOP Syntax power point and use it to fill in the information below.
Object oriented programming defines objects
• Each Jeroo you create is an _______________.An object has ________________
• For example a Jeroo has a: _____________ , ___________________ , ________________
• An object has _________________ (things it can do)
Classes = definitions of objects
When you create a new object it is _______________.
A class describes 3 things:
1. What kind of ____________ is in an object
2. How to make a ___ object of that class (constructor)
o Try this Example: Jeroo quentin = new Jeroo(10,7,EAST,1) ;
▪ Holding ____ flower/s, Location = row ____, column ____, Direction = ________
o The default constructor creates a Jeroo at location ________ facing ___________ with ____ flowers : Jeroo andy = new Jeroo();
3. The _____________ of an object (the actions it can perform)
o 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 and methods
• ______ 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
• • _________: a way to create an object. comes as part of the class definition.
OOP Syntax Practice.
Directions: Open Jeroo and use it answer the questions below.
Jeroo Island N warmup
Using the island at the left, answer the following questions if the Jeroo is at 7,6:
1. What is the location of the flower? ______________________________
2. What is the minimum number of hops required to get the Jeroo at 7,6 onto the flower? _________________________________________________
3. What is the minimum number of times the Jeroo at 7,6 must turn in order to get on top of the flower? ____________________________________
4. After picking up the flower, can the Jeroo hop straight ahead to the EAST and throw the flower at the net to get through? _______Why or why not?_______________________________
5. A jeroo should be facing a flower to pick it up. True or False
6. A jeroo should be facing a net to toss a flower and disable the net. ____True ____False
7. Jerooname.hop(2) will allow a jeroo to hop over a net to get to the other side. ____True ____False
8. When a flower is tossed onto a net, the flower disappears. ____True ____False
Jeroo Code Reading
Directions: Practice your code reading skills: What letters of the alphabet will be created from the 2 different program codes below? You can use the grids below as scratch paper to determine the letters
|Main method () | |Main method () |
|{ | |{ |
|Jeroo kip = new Jeroo(5); | |Jeroo kip = new Jeroo(7); |
|kip.plant(); | |kip.plant(); |
|kip.turn(RIGHT); | |kip.hop(); |
|kip.hop(); | |kip.plant(); |
|kip.plant(); | |kip.hop(); |
|kip.hop(); | |kip.plant(); |
|kip.plant(); | |kip.turn(RIGHT); |
|kip.turn(LEFT); | |kip.hop(2); |
|kip.hop(); | |kip.plant(); |
|kip.plant(); | |kip.turn(RIGHT); |
|kip.hop(); | |kip.hop(); |
|kip.plant(); | |kip.plant(); |
|kip.turn(LEFT); | |kip.hop(); |
|kip.hop(); | |kip.plant(); |
|kip.plant(); | |kip.turn(RIGHT); |
|kip.hop(); | |kip.hop(); |
|kip.plant(); | |kip.plant(); |
|} | |} |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |What is the code to create a Jeroo named Sam that starts out at location (2,7) facing NORTH with 8 flowers?
_______________________________________________________________________________________
9. What is the code to create a Jeroo that starts out facing WEST at location (5,10)with no flowers?
_______________________________________________________________________________________
10. What if a Jeroo jumps in the water, can it jump back out again? _________Can it swim? ____________
11. There is no way to see how many flowers a Jeroo has by looking at the IDE___ True ___ False
12. When a Jeroo is constructed at a location, the first number is the ____ number, the second number is the ________ number.
13. If you add a line of code Tina.pick() after the instantiation statement to the right, is there any way to tell, by looking at the IDE that Tina has the flower?_________________
14. Which Jeroo will end up on the flower? __________________
Succeed
More OPP Practice
Directions: solve the following problems.
1. Beautifying Lake Island Open LakeIsland.jev from the Network save it as Your Initials Lake Island to your folder. Susan starts on Lake Island at location (4,13) facing SOUTH with 4 flowers in her pouch. Her task is to plant the flowers to make the island look like the one shown clockwise around lake.
Save your code to make Susan plant the flowers to your H:Drive as LastnamefirstnameFlowerIsland, then copy and paste the code on the last page.
2. Island N: Look Homeward Angel Angel is ready to leave school (location (7,6) and head for home. Shortly before the last bell, the students were cautioned about the possibility that a North-to-South line of nets had been placed on the island. Write a program to get Angel from the East door of the school into her house of nets in the Northeast portion of the island. Since Angel has no flowers at school, she must pick up a flower on the way home, toss it into a net to get through the barrier, then, go into the house. (Open the Island File named IslandN.jev from the network.) Save your code to move Angel to your H:\Drive as LastnameFirstnameAngel. Then copy and paste the code on the last page. Do not make or save any changes to the Island.
Paste your Flower Island Code Here
Paste your Angel Code Here
-----------------------
20.6
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- december 2006 spald item 1 attachment 2b information
- chapter 9 code tables veterans affairs
- u s army human resources command
- epims data handbook v 9 0
- chapter 4 quiz time management
- documentation
- feasibility study template hud u s
- name that nerd pc mac
- determining veteran status and eligibility for benefits u
Related searches
- last name that means hope
- name that means new beginning
- baby name that means hope
- name that means time
- name that economic system worksheet
- name that song trivia game
- download for pc mac minecraft
- name that means poison
- name that element worksheet
- name that tune lyrics trivia
- name that tune online game
- name that lyric trivia