157k views
11 votes
Algorithm and flowchart to find the perimeter and area of square​

1 Answer

9 votes

Answer:

I can give you the perimeter "algorithm" but not the flowchart.

Here you go:

p = w * 4

p = perimiter,

w = width/height

4 = the amount of sides needed.

perimeter = width * 4

to include both width and height, we would instead use:

perimeter = 2(width+height)

This also works with rectangles ^

--------------------------------------------------------------------------

To find an area, it is just width * height. This is also compatible with rectangles.

User Letroll
by
4.9k points