Menu
Question Index
...

Write a program to find if the given points form a scalene triangle.

Input (Point, Point, Point) Output (boolean)
[0, 0], [50, 0], [-25, 43.3] true
[1, 5], [3, 3], [2, 3] true
[0, -3], [3, -3], [21, 3] true
[5, 0], [8, 0], [6.5, 9] false
[3, 5], [6, 5], [4.5, 10] false



class IsAScaleneTriangle
{
    public static void main(String s[])
    {
        Point firstPoint = new Point(0, 0);
        Point secondPoint = new Point(50, 0);
        Point thirdPoint = new Point(-25, 43.3);
        System.out.println("Given points form a scalene triangle : " + isAScaleneTriangle(firstPoint, secondPoint, thirdPoint));

    }


    public static boolean isAScaleneTriangle(Point firstPoint, Point secondPoint, Point thirdPoint) {
    }
    

}
class Point {

double x;
double y;

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

Doubts

Problems

Topic: Java Multiple Methods In One Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App