Answer :
Answer:
The first answers is with a loop the second one is straight forward

Answer:
The basic layout would be
Function name and in brackets its perimeter values
The while inside declared a variable
Then and the perimeter values and divide by local variable
And end function