Menu
Question Index
...

Write a program to get the equi distant point on the same line. The points defining the line are given.

Input (Point, Point) Output (String)
[0.0, 0.0], [3.0, 2.0] [6.0, 4.0]
[1.0, -1.0], [3.0, -3.0] [5.0, -5.0]
[-2.0, -4.0], [-5.0, -1.0] [-8.0, 2.0]
[32.0, -32.0], [0.0, -32.0] [-32.0, -32.0]
[-48.0, 24.0], [-48.0, 0.0] [-48.0, -24.0]



class GetEquiDistantPoint
{
    public static void main(String s[])
    {
        Point firstPoint = new Point(0.0, 0.0);
        Point secondPoint = new Point(3.0, 2.0);
        System.out.println("Equi distant point is : " + getEquiDistantPoint(firstPoint, secondPoint));

    }


    public static Point getEquiDistantPoint(Point first, Point second) {
    }

}
class Point {

double x;
double y;

public Point(double x, double y) {
this.x = x;
this.y = y;
}

@Override
public String toString() {
return "[" + x + ", " + y + "]";
}
}

Doubts

Problems

Topic: Behavior Of Java Classes Using Methods

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App