Did you try your instructions out? It’s easy to come up with what you think the answer is to this sort of problem. But as a programmer, it’s always important to test your code. If you tried to follow your own instructions, did that lead you to alter them or improve them?
Did you give your instructions to somebody else, and if you did, did you get a cup of tea the way you’d like? Sometimes, instructions that seem unambiguous to us can still have problems. Again, testing your algorithm may have led you to improve it.
If you looked at other learners’ tea-making algorithms, perhaps you’ll have seen ones you disagreed with.
Why were they ‘wrong’?
Did they make tea in a way you don’t enjoy the taste of? For example, was there:
too much sugar?
no lemon?
the wrong kind of tea used?
Or, did they make tea that tasted right but using a process you didn’t agree with? For example, leaving the bag in or adding the milk in the ‘wrong’ order. Is this an algorithm where the logic is important, or is what matters that somebody asking for a cup of tea gets one?
Perhaps you asked for more input. In the first stage of your algorithm, did you ask how the participant likes their tea, and used that to alter the process? Perhaps you didn’t know how to make tea before this exercise. Did you do any research online, or ask a friend?
The tea-making problem illustrates the importance of planning before starting to describe an algorithm, or writing code. To make a robust, repeatable set of instructions for tea-making, you first need to understand the tea-making problem:
What ingredients go into a cup of tea?
Which ingredients or methods might vary depending on who is drinking the tea?
What steps in the process may seem relevant but don’t really matter in terms of the output?
With these options laid out before you, it’s easier to then think about how you’d like to proceed. Will you try to cover all eventualities, or just enough for most people? Will you offer a choice of teas, or just one type?
The actual writing of code is often the shortest part of the process of programming. The planning and decision-making that comes first is often what shapes code the most.