Ask Question
25 February, 22:37

IGCSE Pseudocode

Design an algorithm that asks the user for 15 numbers. The algorithm should work out the total and average of all of the values entered that are in the range of 1-10, then output the number of values in the range, the total and the average.

Write the algorithm as pseudocode and a flowchart.

Eg: If you enter the following data (5, 10, - 2, 9, 1, 2, 3, 14, 1, - 6, 4, 15, 1, 0, 4) the output should be

Number of values = 10

Total = 40

Average = 4

Draw a trace table and show it works for the following test dа ta:

3, 9, 12, - 9, 4, 20, 1, 4, - 1, 6, 0, 3, 11, 7, 7

+1
Answers (1)
  1. 26 February, 02:02
    0
    The algorithm works out the total and average of all of the values entered that are in the range of 1-10, then output the number of values in the range, the total and the average.

    Explanation:

    First Program finds the average of specified array elements.

    Below is the pseudocode for 15 numbers:

    public class JavaExample {

    public static void main (String[] args) {

    double[] arr = [15];

    double total = 0;

    for (int i=0; i
    total = total + arr[i];

    }

    double average = total / arr. length;

    System. out. format ("The average is: %.3f", average);

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “IGCSE Pseudocode Design an algorithm that asks the user for 15 numbers. The algorithm should work out the total and average of all of the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers