r/programminghelp • u/jtc221 • Oct 11 '18
I have recently started a programming class and this is one of the questions What are the basic 2 components of a recipe? I don't understand what to answer for this question and need help their isn't any context or further explanation of this question I am most likely just missing something simple.
2
u/FredTargaryen Oct 11 '18
Is this an intro level class? Unless a recipe is a programming term I haven't picked up on, my guess is they're trying to get you to think about functions. A recipe has ingredients and instructions, and a function has parameters and statements
2
u/worstpossiblechoice Oct 11 '18
I think the other two posters are correct, it is likely ingredients and directions.
It's a decent analogy but a bit abstract.
Look at a recipe, it usually has all the ingredients listed at the top of the page. Then after they are all listed, below them are directions on what to do with the ingredients.
Now look at a typical example Class in say, Java. It will likely have a bunch of variables/fields declared at the top. Then below them are the functions/methods that tell the computer what to do with those variables.
Does that make sense?
3
u/rangercoffee Oct 11 '18
Ingredients and instructions, perhaps?
Sounds like one of those open ended questions that professors ask and let steep in the awkward silence before answering it themselves