Using Jeroo To Teach Object-Oriented Concepts By Christian Digout.
-
Upload
annis-stokes -
Category
Documents
-
view
228 -
download
0
Transcript of Using Jeroo To Teach Object-Oriented Concepts By Christian Digout.
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
Features of the Jeroo ApplicationAnimation 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
Summary of JerooSmall Object-Oriented LanguageOnly one class, the Jeroo class Can instantiate up to four Jeroos Three attributes per Jeroo
◦location ◦direction ◦number of flowers
Summary of JerooSix constructors to initialize the
attributes Seven action methods Seven sensor methods to
examine the immediate surroundings
Four relative directions
InstantiationThe process of creating an
instance of an object.Jeroo has 6 constructors
◦Including a default constructorThe new operator is used to
instantiate objects
Objects and JerooStates (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
Student AssignmentsFrom the Jeroo website:
◦Pick All Flowers◦The Maze◦Walk the Lake◦http://home.cc.gatech.edu/dorn/48
JerooUse of constructorsGet use to the dot-notationUse member methodsCan extend the Jeroo class with
new methods
Java – Building a Classpublic class Circle {
private static final double PI = 3.14;private double radius;
public Circle() {radius = 1;
}
public void setRadius(double newRadius) {
radius = newRadius;}
}
Jeroo ClassIt is written in JavaAsk students what would it
include?◦6 constructors◦Member variables◦Member methods
Turtle GraphicsDownloaded from:http://
www.cengage.com/cgi-wadsworth/course_products_wp.pl?fid=M20bI&product_isbn_issn=9780619267230
Part of textbook resources for:◦Fundamentals of Java by
Lambert/OsbourneAllows students to create simple
graphics using Java
Turtle GraphicsGood for showing:
◦Composition “has a” relationships◦Inheritance “is a” relationships◦Interfaces◦Abstract classes
Turtle GraphicsCreate a Shape InterfaceAbstractShape 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