2Overview In this presentation we will discuss: What is Jeroo? Where did it come from?Why use it?How it works.Your first assignments.
3What is Jeroo?An environment for learning object oriented programming. (OOP)The Jeroo language is a small object-oriented programming language.you create objects and then do things with them.Created in Java.
4Essential Concepts Program – a set of instructions for the computer Source Code – a program written by a programmer in a programming languageCompiler – translates a program (or class) as a whole into another form such as byte code or machine codeInterpreter – translates a program into machine language one statement at a timeJava Byte Code – intermediate language created by the Java compiler. The JVM translates byte code into machine code.Machine Code – program in the form of binary codes - a series of 1’s and 0’s - that are understandable by the computer’s CPU
5Essential Concepts Algorithm – a plan for solving a problem Syntax – a set of rules for writing or speaking a languageSemantics – the meaning associated with valid expressions
6Essential Concepts - OOP Object – represents a specific concept or item that is relevant to a problem to be solved. There are two parts to an object, facts about the object and tasks it can perform.Attribute – is a fact associate with a specific objectBehavior – is an action an object can perform in response to a request from an external source
7Essential Concepts - OOP Method – a collection of statements that are written in some programming language to describe a specific behaviorMethod Precondition – something that is assumed to be true before the method is invokedMethod Postcondition – something that is assumed to be true after the method has been executed
8Essential Concepts - OOP Message – a request for a specific object to perform a specific task When we ask an object to perform a task (behavior), we are sending a message to the object or invoking the method that describes the task.
9Essential Concepts - OOP Class – is a collection of statements that are written in some programming language to describe both the attributes and the behaviors of an object.Instantiation – the process of creating a specific object. Jeroo clyde = new Jeroo(); clyde is an instance of the Jeroo class.
10Where did Jeroo come from? NW Missouri State UniversityUsed in introductory college programming classes.Under developmentIt’s free.
11Why use Jeroo? Jeroo keeps the focus on important topics. Students master ideas faster.Jeroo stimulates problem solving.Jeroo encourages experimentation.It’s fun!
12Jeroo Jeroos Humans arrive and set nets to catch Jeroos. Place: Santong Island in the South PacificTwo unknown speciesJeroo: similar to the wallabies of AustraliaWinsum Flower: Jeroo's source of foodJerooshave a pouch to hold flowerscan't swim – fur gets waterlogged-must dryHumans arrive and set nets to catch Jeroos.
13The Jeroo environment The island is made of rows and columns. The programmer chose to number both the rows and columns starting with zero at the northwest corner of the island.(0,0)(0,1)(?)(3,2)NORTHWhat location is this?
14Programming steps A Jeroo can execute 6 action methods hop() hop once or hop(n) to hop n timesturn( relative_direction )pick() pick a flowerplant() plant a flower from the pouchtoss() throw a flower one space ahead.Give (relative direction) give a flower to another jerooThey always follow directions in order, from top to bottom.Put it all together to solve various problems.
15How Jeroo works 3 steps: Create your environment Write the program Run the program
16Icons used to create and edit islands Set the speed of the JeroosCreate a new island layoutOpen an existing islandSave the islandSave asPrintPlant flowers on the islandSet nets on the islandAdd water to the islandClear the island layout (remove all extra flowers, water and nets)Get help with the Jeroo languageQuit Jeroo
17Step 1. Create the Environment To start:Open an existing Island FileOr Create your own IslandAdd or remove:FlowersNetsWaterLandYou can save and re-use your islands.
18Learn how to create islands. Select water, flower or netleft-click to addright-click to removeLearn how to save islands.Programs and islands are saved separatelySource_file save (.jsc)Island_file save (.jev)
19A video demonstrating the Jeroo environment To create your environment in Jeroo:Left-click to drawRight-click to remove(click the link below)Start the video
20Your first island: Assignment Design an island that uses water, nets and flowers to create an attractive design based on one or more of your initials.Click the floppy disk on the island side and save as yournameLetterIsland1 to your folder by clicking the down arrow for Save in and choosing the Thawspace (T:) and double clicking the lower case: wbhs-lab6105 (middle) and double clicking My Documents folder and double clicking your folder.Print your island design. Now try to make the rest of your initials yournameLetterIsland2 and 3
21The End Staple the fill in the blank sheet on top of your print out. With the rubric
23Overview In this presentation we will discuss: How to write code in JerooHow to run a Jeroo program
24Review: Step 1. Create the Environment To start:Open an existing Island FileOr Create your own IslandAdd or remove:FlowersNetsWaterLandYou can save and re-use your islands.
25Step 2. Write the program You can create and control up to 4 Jeroos. Your program must have a main methodEach Jeroo gets a name when it is createdRefer to them by name to send them a message
26The constructor statement Jeroo alfred = new Jeroo()A new Jeroo is created and assigned the name alfred.alfred will appear in the top left corner of the island, facing east.All statements in the main program must specify which Jeroo is to act, and what it is to do.alfred.toss()tells alfred to toss a flower into the space ahead.
27Coding practice Answers: Jeroo neo = new Jeroo(); neo.hop( ); Write the code to create a new Jeroo named neoWrite the code to make neo hopWrite the code to make neo turn right.Jeroo neo = new Jeroo();neo.hop( );neo.turn(RIGHT);
28Choosing directions Four relative directions Four compass directions LEFTRIGHTAHEADHEREFour compass directionsNORTHSOUTHEASTWESTWhen you turn, you must specify a relative direction
29hoppinghop() alone means hop once in the direction the Jeroo is facinghop(n) will tell the Jeroo to hop n timesExample:alexandria.hop(3);is the same as:alexandria.hop();Write the code to make neo hop forward 5 times .neo.hop(5);
30Step 3: Run the programAnimation shows Jeroos moving around the islandSource code highlights while executingYou can run one step at a timeRun the whole program continuouslyPause at any timeGo back to the beginning, or stop
31Watch a program running the code is highlightedthe Jeroo actsClick the link to see demonstration of A Jeroo program running continuously
32Step 3: Run the program 3 different language modes You want Java/C++/C#
33Find the logic errorsGo to Jeroo and create a flower at 3,2. (left click to create a flower, right-click to erase a flower)Type the commands exactly as you see them then run the program to find the errorsSave it as Your Initials Alexandria to your folder
34Your First Program Start Jeroo Enter your name 1. Create the environmentClear the island layout.Place a flower at location Row 12 Column 122. Write the programCreate a Jeroo with your nameTell it to hop to the flowerTell it to pick the flower3. Run the programIf it doesn’t work, fix it!
35The program goes in the main method Create a Jeroo with your nameJeroo mrsH = new Jeroo( );It will appear in location 0,0 facing EAST with no flowers in its pouch.Tell it to hop onto the location with the flowermrsH.hop( );You must address your Jeroo by name.repeat this statement each time you want your Jeroo to hop mrsH.turn (relative direction);You must turn either LEFT or RIGHTTell it to pick the flower: the Jeroo must be ontop of the flower to pick itmrsH.pick( );It will stop when it reaches the end of the program.
36Top GradeWrite a program to get a Jeroo from one end of your original letter island to the other using AT LEAST 8 programming steps.Save the program as yourNameLetterIsland (the programming code will be saved with .jsc for jeroo source code as the extension. The island will be saved with .jev for jeroo environment as the extension so it is safe to name the island the program with the same name)