The document discusses the integration of Greenfoot in teaching inheritance and polymorphism in a CS1 course at the Open University of Israel. It outlines an assignment that includes four questions designed to engage students in understanding these concepts through practical coding tasks using the Greenfoot environment. Results indicate that students enjoyed the assignment and creatively expanded the game with original ideas.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
5 views1 page
Vil Ner 2011
The document discusses the integration of Greenfoot in teaching inheritance and polymorphism in a CS1 course at the Open University of Israel. It outlines an assignment that includes four questions designed to engage students in understanding these concepts through practical coding tasks using the Greenfoot environment. Results indicate that students enjoyed the assignment and creatively expanded the game with original ideas.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
Using Greenfoot in Teaching Inheritance in CS1
Tamar Vilner Ela Zur Shay Tavor
The Open University of Israel The Open University of Israel The Open University of Israel Computer Science Dept. Computer Science Dept Computer Science Dept 1 University Road 1 University Road 1 University Road Raanana, Israel Raanana, Israel Raanana, Israel tami@openu.ac.il ela@openu.ac.il shay.tavor@gmail.com
ABSTRACT code. This will help them with later sections.
In the Open University of Israel CS1 course, there are eight 2. In question 2 the students were asked to add some new classes assignments contributing various percentages to the overall course which should inherit from the class Balloon and to change assessment. The concepts of inheritance and polymorphism are some existing classes. They had to consider carefully which covered in assignment 5. In the fall semester of 2009, assignment inherited methods from the Balloon class should be used and 5 was changed to demonstrate these topics using the Greenfoot which should be overridden. The rationale behind this question environment. Here we describe this assignment and its rationale. is that students should make new inherited classes, a new abstract class, and understand which methods should be made Categories and Subject Descriptors abstract, which need to be overridden and which inherited. K.3.2 [COMPUTERS AND EDUCATION]: Computer and 3. In question 3 the students were asked to create a new Ball class Information Science Education. that inherits from the Actor class. They had to make the General Terms necessary changes in code such that the program will now Human Factors. include balls in the game, which should move across the screen in certain speed and proportion vs. the balloons. The rationale Keywords for this question was to force the student to make changes and CS1, Visualization, Games, Inheritance and Polymorphism. understand the code in the Dart, Bomb and Explosion classes, and use inheritance related subjects such as polymorphism, 1. INTEGRATING GREENFOOT IN CS1 instanceof, casting, etc., by making the Ball class inherit from One of the main topics in the course is inheritance. Usually, when Actor, even though it would have been more "correct" to have teaching this subject, simple examples like shapes or animals are made a "target" class from which all targets (balloons and ball) demonstrated. When further practice is needed, more complex would inherit. examples, rather than "toy" problems, are preferable. Greenfoot 4. In question 4 the students were asked to create their own new enables the use of scenarios and the creation of complex examples and original dimension for the game. They also had to describe without dealing with the details of GUI, so that students can the elements that they added to the game. The rationale for this concentrate on the main topic – inheritance, but still have nice question was to allow the students to be creative and to visual effects. challenge them to investigate the Greenfoot environment and Assignment 5 deals with the concepts of inheritance and the topics of inheritance and polymorphism, by inventing a polymorphism. new dimension for the game. Since the Greenfoot system supports the customized addition of classes, attributes and The following paragraphs describe the assignment we gave to the methods, and lets developers use graphics without writing their students; after each question we present its rationale. own, it is easy to implement interesting ideas and see how they The assignment was based on the Balloons scenario supplied with behave. the standard Greenfoot package [1]. The assignment had two parts. In the first part, there was an explanation about the 2. RESULTS Greenfoot environment and installation, and the students had to The solutions students submitted to the fourth question showed familiarize themselves with the Balloons scenario and explore its that they indeed enjoyed the assignment. The students were asked features and capabilities. to create their own new and original dimension to the game. Of course, many of them added expected elements, but some students The second part of the assignment included four questions: created some beautiful extensions to the game. 1. In question 1 the students were asked to read the APIs for the For example, one student added hot air balloons and magnets. Hot World and Actor classes and the code for all of the other air balloons appear one at a time and move five times as fast as classes included in this scenario, and to answer questions that regular balloons. When a hot air balloon is popped, a magnet make sure that the students read and get to know the scenario appears in its place. The magnet spins round and round gathering speed and pulls all the balloons and balls in the vicinity towards it. When the magnet reaches a certain speed it blows up all nearby balloons and balls. Copyright is held by the author/owner(s). ITICSE‘11, June 27–29, 2011, Darmstadt, Germany. ACM 978-1-4503-0697-3/11/06. 3. REFERENCE [1] Greenfoot Website: http://www.greenfoot.org