| /home/chloe/ASDV-Java/MP2_ChloeFontenot/src/main/java/com/chloefontenot/mp2_chloefontenot/TrianglePerimeter.java |
package com.chloefontenot.mp2_chloefontenot;
public class TrianglePerimeter {
public static void main(String[] args) {
java.util.Scanner input = new java.util.Scanner(System.in);
System.out.print("Enter three edges (length in double): ");
double edge1 = input.nextDouble(),
edge2 = input.nextDouble(),
edge3 = input.nextDouble();
boolean isValid = (edge1 + edge2 > edge3) && (edge1 + edge3 > edge2) && (edge2 + edge3 > edge1);
if (isValid)
System.out.println("The perimeter is " + (edge1 + edge2 + edge3));
else
System.out.println("Input is invalid");
}
}