Rubrics Vs. Zombies

Zombie code is code that doesn’t run or doesn’t do anything. For Example:

if (animal == "cat" && age < 18) {
  adopt = false;
} else if (animal == 'cat' && age > 18) {
  adopt = true;
} else if (animal == "dog" && age < 18) {
  adopt = false;
} else if (animal == "dog" && age > 18) {
  adopt = true;
}
if (age < 18) {
  adopt = true;
} else {
  adopt = false;
}

The rubric says you need a logical expression with && or ||. We have that here. But the code is zombie code. It runs but it doesn’t have any impact on the program’s execution. Does this count against the rubric?

I am going to say yes, zombies count against the rubric. This student knows how to use &&.

But I decided to take a close look at the Create Task instructions. 3.c.i.2 has this “Contains and uses one or more parameters that have an effect on the functionality of the procedure.” an effect on the functionality explicitly means zombies don’t count against the rubric.

So if we take our goal (AP score) seriously we should probably not accept zombie code. The collage board will not and we are forbidden from telling our students “that is zombie code right there.”

What do you think?