program distance; uses crt; {-------------------------------------------------------------------------- This program will ask for the cordinates of 2 points and then compute the distance between them. by --------------------------------------------------------------------------} VAR x1,x2,y1,y2:real; again:char; begin repeat clrscr; textcolor(green); write ('What is the X axis value of the first point''s cordinates? ---> '); readln (x1); writeln; write ('And please type in the Y axis value for that point ---> '); readln (y1); writeln; writeln; write ('Now type in the X axis value for the second point''s cordinates ---> '); readln (x2); writeln; write ('And finally, the Y value for the second point ---> '); readln (y2); writeln; writeln; writeln; x1 := sqrt(sqr(x1 - x2) + sqr(y1 - y2)) ; textcolor (red); writeln ('The distance between the 2 points is ',x1:0:3); textcolor(blue); writeln; writeln; writeln('Try another set of points?'); write('Type "y" for yes, "n" for no'); again := readkey; until again = 'n'; end.