/home/caleb/ASDV-Java/MP2_CalebFontenot/src/main/java/com/calebfontenot/mp2_calebfontenot/TrianglePerimeter.java |
package com.calebfontenot.mp2_calebfontenot;
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");
}
}