
Nelson R. answered 10/04/19
Effective Ph.D. Chemistry and Computer Tutor
There are many methods of creating Pseudo code, which is basically a algorithm that you mentally test to see if your programming logic has any flaws. Different teachers have different standards for what they want for Pseudo code. for a while loop it depends on whether you test the condition at the beginning or end of the loop. This is what I came up with:comment initilize variables
pig count = 0
sheep count = 0
animal count = 0
Do While animal not equal zero
Catch animal
if not caught before then
Animal count = animal count + 1
If pig then pig count = pig count + 1
else sheep count = sheep count + 1
end if
End if
loop
output %pigs = ( pig count/(pig count + sheep count)) *100
output %sheep = ( sheep count/(pig count + sheep count)) *100
It is by no means the only Pseudo code that would meet the criteria.