forked from cs-dept-ibbul/java2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab3TriangleDemo.java
More file actions
24 lines (20 loc) · 1000 Bytes
/
Copy pathLab3TriangleDemo.java
File metadata and controls
24 lines (20 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.Scanner;
public class TriangleDemo
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.println("Please enter the sides of the Triangle\n First Side: ");
int firstSide = input.nextInt();
System.out.println("Second Side: ");
int secondSide = input.nextInt();
System.out.println("Third Side: ");
int thirdSide = input.nextInt();
Triangle triangle = new Triangle(firstSide, secondSide, thirdSide);
System.out.println("The Perimter of the Triangle is: " + triangle.getPerimeter());
System.out.println("The Area of the Triangle is: " + triangle.getArea());
System.out.println("The Longest side of the Triangle is: " + triangle.hypotenus);
System.out.println("The Shortest side of the Triangle is: " + triangle.shortestSide);
System.out.println("The remainder is: " + triangle.getRatio());
}
}