@@ -0,0 +1,409 @@
+package ru.tsibrovskii.lesson1.ConditionOperator;%0A%0Apublic class Triangle %7B%0A%09%0A%09public Point a;%0A%09public Point b;%0A%09public Point c;%0A%09%0A%09public Triangle(Point a, Point b, Point c) %7B%0A%09%09this.a = a;%0A%09%09this.b = b;%0A%09%09this.c = c;%0A%09%7D%0A%09%0A%09public double area() %7B%0A%09%09//calculate the triangle area%0A%09%09double area = 0.5*((a.x - c.x)*(b.y - c.y) - (b.x - c.x)*(a.y - c.y));%0A%09%09if (area %3E 0)%0A%09%09%09return area;%0A%09%09else%0A%09%09%09return -1;%0A%09%7D%0A%7D

add triangle