ask "Does the adult animal have a backbone? (yes/no)" and save the answer as backbone
if backbone = yes then
ask "Does it have feathers? (yes/no)" and save the answer as feathers
if feathers = yes then say "Bird"
else
ask "Does it have hair or fur? (yes/no)" and save the answer as fur
if fur = yes then say "Mammal"
else
ask "Does it have fins? (yes/no)" and save the answer as fins
if fins = yes then say "Fish"
else
ask "Is its skin dry and scaly? (yes/no)" and save the answer as scaly
if scaly = yes then say "Reptile"
else say "Amphibian"
else
ask "Does it have jointed legs? (yes/no)" and save the answer as jointed
if jointed = yes then
ask "How many legs does it have?" and save the answer as legs
if legs = 6 then say "Insect"
else if legs = 8 then say "Arachnid"
else say "Another arthropod: maybe a crustacean, centipede or millipede"
else say "Another invertebrate: maybe a mollusc, worm, jellyfish or sea star"
A dichotomous key as code. Each "ask" gets input from the user, and each "if" is one split in the key.