5. Define a procedure “DistanceBetweenTwoPoints” that will take four paramaters x1, y1, x2
and y2 and will calculate the distance between these two points using the formula
√((x2 – x1)² + (y2 – y1)²). You must use the SquareRoot function you defined previously.
[10 points]
Test case:
> (DistanceBetweenTwoPoints 2 5 3 2)
3.1622776601683795
Can anyone please help me to write this procedure in Scheme Language? I am stuck! Please help!

See Answers (1)

Accepted Answer

Using the knowledge in computational language in JAVA it is possible to write the code that define a procedure “DistanceBetweenTwoPoints” that will take four paramaters x1, y1, x2 and y2.Writting the code:package org.totalbeginner.tutorial;public class Point {    public double x;    public double y;    Point(double xcoord, double ycoord){        this.x = xcoord;        this.y = ycoord;    }    public double getX() {        return x;    }    public double getY() {        return y;    }    }package org.totalbeginner.tutorial;public class Line {    double x;    double y;    Point p1 = new Point(2.0,2.0);    Point p2 = new Point(4.0,4.0);    Point mp = new Point(x,y);    public void midpoint() {        x = (p1.getX() + p2.getX()) / 2;        y = (p1.getY() + p2.getY()) / 2;    }See more about JAVA at brainly.com/question/12975450#SPJ1

Related Question in Computers and Technology