Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ukolpoleretezce;
- /**
- * @author seberm
- */
- public class Triangle {
- // Params: //
- private int a = 0;
- private int b = 0;
- private int c = 0;
- // Constructors: //
- Triangle (int a, int b, int c) {
- if ((a + b) > c)
- return;
- this.a = a;
- this.b = b;
- this.c = c;
- }
- /**
- * Vytvori rovnostranny troj.
- * @param side
- */
- Triangle (int side) {
- this(side, side, side);
- }
- /**
- * Vytvori rovnoremenny troj.
- * @param sideA
- * @param sideB
- */
- Triangle (int sideA, int sideB) {
- this(sideA, sideB, sideB);
- }
- /**
- * Counts the district of triangle
- * @return
- */
- public double district () {
- return (this.a + this.b + this.c);
- }
- /** Returns true if triangle is rectangular
- *
- * @return
- */
- public boolean isRectangular() {
- double pomC = Math.sqrt((a*a)+(b*b));
- if (c == pomC)
- return true;
- else return false;
- }
- }
Add Comment
Please, Sign In to add comment