Ask Question

The following algorithm computes the average height for a list of basketball player heights. Initialize a variable sum to 0. For each height in the list: Convert height from feet & inches format to total inches Add height to sum. Return sum divided by the total number of heights. Which building blocks are involved in this algorithm?

+5
Answers (2)
  1. 11 December, 04:26
    0
    Sequencing and Iteration

    Explanation:

    An algorithm is a set of instructions that enable us to solve a problem. There three main pieces of algorithm: sequencing, selection and iteration.

    Sequencing implies the order of the execution. In this example, it can be seen as initializing the variable sum before calculating the height.

    Iteration implies the repetition. In this example, it can be seen as converting each height.

    Selection is another building block that is used if there are conditions/different paths in the algorithm.
  2. 11 December, 04:28
    0
    Sequencing and Iteration

    Explanation:

    Sequencing is a part of all programs, as it's just the fact that computers execute programs in a particular sequence (like top to bottom line in a simple program).

    Iteration on the other hand is when we use loops to repeat code in a program.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “The following algorithm computes the average height for a list of basketball player heights. Initialize a variable sum to 0. For each ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers