Reading Algorithms: Function and FOR Loop (3 marks)
A simple algorithm in pseudocode is given below: FUNCTION CalculateTotal(numbers) SET sum TO 0 FOR EACH number FROM numbers DO SET sum TO sum + number END FOR RETURN sum END FUNCTION A student executed the algorithm using the list [3, 7, 2, 5]. Determine the final value returned by the CalculateTotal function. Show your […]
Reading Algorithms: Function and FOR Loop (3 marks) Read More »