For the analogy regarding code, the best choice is: "Lines of computer code are like individual steps in a recipe."
This analogy works well because just as a recipe consists of individual steps that must be followed in a specific order to create a dish, code consists of lines that work together to instruct a computer to perform tasks.
For the explanation of the role of a programmer, the best choice is: "writing code that tells a computer what to do."
This definition accurately captures the primary function of a programmer, which is to create instructions (code) that dictate how a computer operates and performs tasks.