asked 86.9k views
4 votes
Write a pseudocode algorithm that uses the For Each loop to display all of the

values in the following array:
Constant Integer SIZE = 10
Declare Integer values[SIZE] = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

2 Answers

6 votes

Here is a pseudocode algorithm that uses the For Each loop to display all of the values in the given array:

```

declare a constant integer named SIZE and set its value to 10

declare an integer array named values with SIZE elements and initialize it with the values 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10

for each integer value in values do

display the value

end for

```

This algorithm first declares a constant integer `SIZE` and an integer array `values` with `SIZE` elements, initialized with the given values. It then uses a For Each loop to iterate through each value in the `values` array and display it. The loop will execute 10 times, once for each element in the `values` array.

answered
User Tmighty
by
8.7k points
7 votes
so i’m not sure it’s making me answer a question
answered
User Maephisto
by
8.9k points