The students in Mrs. Mitzenmacher's class have been working on the divisibility rules over the last couple of weeks.  To help them share their understanding of the concepts, the students (working in pairs) were given the opportunity to create a Scratch program demonstrating the appropriate rules.  

Each team's program needed the following components:
  1. The computer would generate a random number (between 1 - 100)
  2. The code would include a series of IF or IF-ELSE statements.
  3. The program needs to display the appropriate answer (i.e.. Divisible or Not Divisible)

To introduce the concept (of IF-THEN statements), I read the short-story to the students , Computational Fairy Tales - Learning IF-THEN-ELSE the hard way.
Ann had learned the value of IF-ELSE statements at a very early age. When she was only three years old, she was given VERY strict instructions from the castle's head chef NOT to randomly eat things in the kitchen. Specifically, she was told:

IF the food is on the 'finished' table
     You can eat it.
      Do not eat it.

Of course, as any three year old is bound to do, Ann ignored these instructions. She would sneak into the kitchen and eat pieces of fruit off of the chef's prep table. Each time that the chef caught her, he would give her a lecture about obeying the IF statement. His lectures would last a full ten minutes and include at least one remark about "kids these days". Ann enjoyed listening to him describe the branching logic of the IF statement almost as much as she enjoyed sneaking fruit. In fact, some days she even made sure that she was caught so that she could listen to his rants. ........

Finished Project:

Leave a Reply.