Created
May 4, 2020 11:42
-
-
Save kryvoboker/5ef7ce0ed929bda58a96ab95c91835dc to your computer and use it in GitHub Desktop.
HomeWork2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AreaOfTriangle { | |
public void AreaOfTriangle() { | |
double a = 33.4; | |
double b = 25.8; | |
double c = 13.6; | |
double perimeter = 0.5*(a + b + c); | |
double area = Math.sqrt(perimeter*(perimeter-a)*(perimeter-b)*(perimeter-c)); | |
System.out.println("Area of a Triangle: " + area); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment