Information Technology Reference
In-Depth Information
gives Carl the chalk, puts 1 in his pocket, and waits at the side of the
classroom next to Anna.
− At this point it is recommended to pay students' attention to how the
stack is being built, where Anna is waiting first and Burt is waiting next
to her.
− Carl checks the value in his pocket (  n ) and checks if 1 < 1 . Since this
check yields false, Carl continues to the else-clause. He knows how to
perform System.out.println , and he prints 1 on the blackboard. Then,
Carl should perform mystery(n−1) and he calls Danna to perform this
task. Carl gives Danna the chalk, puts 0 in her pocket, and goes standing
at the side of the classroom, next to Anna and Burt.
− Danna looks for the n 's value in her pocket and checks if 0 < 1 . Since the
condition is satisfied, Danna turns to the then-clause. Since she knows
how to perform System.out.println , she prints “finished” on the black-
board. At this point, Danna finishes her task, turns to Carl (the little
person who asked her to perform her job), returns him the chalk and,
after she is thanked by Carl, she returns to her seat.
− In the class, it is recommended to pause the process at this point and
ask the students how, in their opinion, the role play should continue.
It is also important to emphasize that at this point the 3 little people—
Anna, Burt, Carl—are still waiting to continue their jobs from the point
they stopped it, but each of them has a different value of n in his or her
pockets.
− After Carl thanks Danna for her help, he continues to the last instruction
he should perform. He checks n 's value in his pocket (sees that it is 1)
and prints 1 on the blackboard. Carl turns to Burt (who hired him) and
gives him the chalk.
− Burt thanks Carl for his help and continues to the last instruction he
should perform. He prints 2 (  n 's value in his pocket) on the blackboard,
turns to Anna and gives her the chalk.
− Anna thanks Burt for his help, prints 3 (  n 's value in her pocket) on the
blackboard, turns to the chief person and returns him the chalk.
• This ends the role play and a whole class discussion about the process
starts.
• Stage B: Class discussion
• During the discussion, the students are encouraged to reflect on the process
they just saw, addressing its advantages and disadvantages. For example,
since the model is based on a metaphor (see Sect. 7.2.6), it is another
opportunity to discuss metaphors as a pedagogical tool.
• If time permits, it is recommended to give the students a “reversed” task;
that is, the students are given a textual description of the little people role
play of another recursive method and they are asked to reconstruct the
original method in Java.
 
Search WWH ::




Custom Search