Write an algorithm prompts a user to enter 15 masses of goats and display average mass

sum=0

for i=1..15
print "Enter mass"
read mass[i]
sum += mass[i]
end for
print "Average mass: ",sum/15

Certainly! Here's a Python algorithm that prompts the user to enter 15 masses of goats and then displays the average mass:

1. Initialize a variable `total_mass` to 0 to keep track of the sum of the masses.
2. Initialize a variable `goat_count` to 0 to keep track of the number of goats.
3. Iterate 15 times using a for loop. For each iteration:
a. Prompt the user to enter the mass of a goat using the `input()` function.
b. Convert the input to a float using the `float()` function.
c. Add the entered mass to `total_mass`.
d. Increment `goat_count` by 1.
4. Calculate the average mass by dividing `total_mass` by `goat_count`.
5. Display the average mass to the user.

Here's the algorithm implemented in Python:

```python
total_mass = 0
goat_count = 0

for _ in range(15):
mass = float(input("Enter the mass of a goat: "))
total_mass += mass
goat_count += 1

average_mass = total_mass / goat_count
print("The average mass of the goats is:", average_mass)
```

You can run this code in any Python environment, and it will prompt you to enter the mass of each goat. Finally, it will display the average mass of the goats.