Download presentation
Presentation is loading. Please wait.
Published byAnnis Stokes Modified over 9 years ago
1
Using Jeroo To Teach Object-Oriented Concepts By Christian Digout
2
What is Jeroo? A tool for helping students learn object- oriented concepts including: ◦ Instantiating and using objects ◦ Constructors ◦ Writing methods to extend behavior ◦ Information Hiding
3
Jeroo Layout
4
Example of a Program
5
Features of the Jeroo Application Animation showing Jeroos moving around the island Source code highlighting synchronized with execution Stepwise or continuous execution mode Choice of execution speeds Ability to switch between execution modes and change speeds at will Error messages
6
Summary of Jeroo Small Object-Oriented Language Only one class, the Jeroo class Can instantiate up to four Jeroos Three attributes per Jeroo ◦ location ◦ direction ◦ number of flowers
7
Summary of Jeroo Six constructors to initialize the attributes Seven action methods Seven sensor methods to examine the immediate surroundings Four relative directions
8
Instantiation The process of creating an instance of an object. Jeroo has 6 constructors ◦ Including a default constructor The new operator is used to instantiate objects
9
Constructors
10
Objects and Jeroo States (or member variables) Position (x, y) Direction (North, East, South, West) Number of flowers Information Hiding ◦ A Jeroo’s data is protected ◦ Protects data integrity ◦ Need to use member methods to access member variables
11
Behavior and Member Methods
12
Behaviors and Member Members
13
Student Assignments From the Jeroo website: ◦ Pick All Flowers ◦ The Maze ◦ Walk the Lake ◦ http://home.cc.gatech.edu/dorn/48
14
Jeroo Use of constructors Get use to the dot-notation Use member methods Can extend the Jeroo class with new methods
15
Java – Building a Class public class Circle { private static final double PI = 3.14; private double radius; public Circle() { radius = 1; } public void setRadius(double newRadius) { radius = newRadius; } }
16
Jeroo Class It is written in Java Ask students what would it include? ◦ 6 constructors ◦ Member variables ◦ Member methods
17
Turtle Graphics Downloaded from: http://www.cengage.com/cgi- wadsworth/course_products_wp.pl?fid=M 20bI&product_isbn_issn=9780619267230 http://www.cengage.com/cgi- wadsworth/course_products_wp.pl?fid=M 20bI&product_isbn_issn=9780619267230 Part of textbook resources for: ◦ Fundamentals of Java by Lambert/Osbourne Allows students to create simple graphics using Java
18
Turtle Graphics Good for showing: ◦ Composition “has a” relationships ◦ Inheritance “is a” relationships ◦ Interfaces ◦ Abstract classes
19
Turtle Graphics Create a Shape Interface AbstractShape can implement Shape ◦ Can implement members that would be the same for all shapes such as: X and Y coordinates Move function ◦ Abstract methods would be: Area Draw
20
Shape Hierarchy Can implement Circle and Rectangle Classes with students. ◦ Extend Abstract Shape Assignment: ◦ Students implement a Triangle Class ◦ Students can add a Perimeter Method to the hierarchy
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.