/home/caleb/ASDV-Java/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/Triangle.java |
package com.calebfontenot.lab6_calebfontenot;
import java.util.Scanner;
public class Triangle {
public static void main(String[] args) {
double x1,
y1,
xIntercept;
Scanner input = new Scanner(System.in);
System.out.print("Enter a point's x and y coords: ");
x1 = input.nextDouble();
y1 = input.nextDouble();
xIntercept = ((-0.5 * x1) + 100);
System.out.println("x intercept is " + xIntercept);
if (y1 <= xIntercept)
{
System.out.println(x1 +", "+ y1 + " is inside of the triangle!");
}
else
{
System.out.println(x1 +", "+ y1 + " is outside of the triangle!");
}
}
}