Ants (Playful OOP)

Class definition, basic work with classes

4h 5min

Tasks 1.2-1.8


Understanding the basic principles of object-oriented programming (60%)
Understanding the syntax of the Java programming language (20%)
The ability of creating own programs with the use of OOP (20%)
Object and classes
Acquisition
1 Basic concepts

Object


10 min
Investigation
2 Exercise

Identification of objects and their properties


20 min
Acquisition
3 Basic concepts

Class, instance, inheritance


15 min
Creating an instance of the world
Practice
1 Orientation in greenfoot

World, Actor, MyWorld


10 min
Discussion
2 Code observation

Class constructor


10 min
Practice
3 Prepare world

Try to change world graphics, try to set parameters of world etc., instance world


30 min
Creating a class
Acquisition
1 Basic concepts

Class, object identity, internal state


25 min
Production
2 Task 1.2

Create class Wall


10 min
Practice
3 Task 1.3

Create class Tower


15 min
Defining class attributes/fields
Acquisition
1 Basic concepts

Class properties, working with class state


15 min
Production
2 Task 1.4

Define height for wall


10 min
Production
3 Task 1.5

Assign value for wall height


10 min
Practice
4 Task 1.6

Repeat for tower


20 min
Constructors
Acquisition
1 Basic concepts

Object creation, constructors


15 min
Production
2 Task 1.7

Move tower height initialization to constructor


10 min
Practice
3 Task 1.8

Repeat for Tower


20 min