# Northern Kentucky University Object-Oriented Programming Worksheet

Description

Don't use plagiarized sources. Get Your Custom Essay on
Northern Kentucky University Object-Oriented Programming Worksheet
Just from \$13/Page

Consider a right triangle with vertices at (0,0), (0.yı), and (x2,0) as shown in the figure below. Suppose
you are given the coordinates of a test point (x,y). Write a program that prompts the user to enter y1, x2,
x, and y and then checks if the test point is within the triangle. (If it is on one of the edges of the triangle,
it is also considered to be within the triangle.) The coordinates of the vertices and test points may be any
real numbers, including negative numbers.
Submit your source code in a file named In Triangle.java!
(0,7)
(x,y)
(0,0)
(x2,0)
Sample console input and output (inputs preceded by »):
Enter the y-coordinate of the first triangle point:
> 100
Enter the x-coordinate of the second triangle point:
> 200
Enter the x- and y-coordinates of the point to test:
The test point is inside the triangle
> 50 25