A programmer is generating results by iterating rows that provide values needed for one calculation. Which of the following functions best accomplishes this task?
Correct Answer: D
Explanation
Looping is a function that allows a programmer to repeat a block of code for a certain number of times or until a condition is met. This is useful for iterating rows that provide values needed for one calculation, as it can perform the same operation on each row without writing redundant code. Branching is a function that allows a programmer to execute different blocks of code depending on a condition, such as an if-else statement.
Pausing for input is a function that allows a programmer to stop the execution of the code and wait for the user to enter some data, such as using the input() function in Python. Sorting is a function that allows a programmer to arrange a collection of data in a certain order, such as ascending or descending. References: CompTIA IT Fundamentals (ITF+) Study Guide: Exam FC0-U61, Second Edition, Chapter 4: Software Development Concepts, page 139