Find the perimeter of a pentagon from the known coordinates of its vertices, using the procedure

Find the perimeter of a pentagon from the known coordinates of its vertices, using the procedure for calculating the length of a segment from the known coordinates of its ends.

program zz1;
const x1 = 2; // set the coordinates of the vertices of the pentagon
y1 = 2;
x2 = 12;
y2 = 12;
x3 = 20;
y3 = 20;
x4 = 26;
y4 = 2;
x5 = 21;
y5 = 12;
var p, st1, st2, st3, st4, st5: real;
procedure dl (a, b, c, d: real; var g: real);
begin
g: = sqrt (sqr (a – c) + sqr (b – d)); // calculate the side length using the formula
end;
begin
dl (x1, y1, x2, y2, st1);
dl (x3, y3, x2, y2, st2);
dl (x3, y3, x4, y4, st3);
dl (x5, y5, x4, y4, st4);
dl (x1, y1, x5, y5, st5);
p: = st1 + st2 + st3 + st4 + st5;
write (‘pentagon perimeter =’, p); // display the answer
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.