logo CodeStepByStep logo

ComputeDistance

Language/Type: VB parameters Math

Write a function named ComputeDistance that accepts four integer coordinates x1, y1, x2, and y2 as parameters and computes the distance between points (x1, y1) and (x2, y2) on the Cartesian plane. The formula for the distance between two points is:

distance equation

For example, the call of ComputeDistance(10, 2, 3, 5) would Return 7.615773105863909.

Function: Write a VB function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.