Which of the following examples correctly describes the order in which these parts of a program should be written? (Select the best answer.)
A- The import command, then function definitions, then function calls
B- Function definitions, then the import command, then function calls
C- Function calls, then function definitions, then the import command
D- The import command, then function calls, then function definitions
My choice is either A or D, but I am a little unsure as to which is the correct answer. Please help!
3 answers
The languages vary, but in the strictest case, functions must be defined before they can be called, so A is my choice.
The above comment refers to the actual
syntax of the program.
During the design, however, it is quite common to write the calls first, as that sets up the program flow of logic. Then the function definitions fill in the details.
syntax of the program.
During the design, however, it is quite common to write the calls first, as that sets up the program flow of logic. Then the function definitions fill in the details.
A is the correct answer! I took my quiz and got a 100% thank you so much for your help! :)