Ask Question
9 February, 22:49

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?

+3
Answers (2)
  1. 9 February, 23:22
    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.
  2. 10 February, 00:32
    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.
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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers