Your Java application will prompt the user to enter the two-dimensional integer coordinates of three points - (x1, y1), (x2, y2), and (x3, y3). You will check if these points form the vertices of a right-angled triangle. Your program will output a statement regarding the outcome. All your inputs and outputs are from the console. A typical session will look like:
Please enter the coordinates of
Point
1: 0 0
Please enter the coordinates of Point
2: 3 0
Please enter the coordinates of Point
3: 0 4
Yes, they form a right angled triangle.
The square of the distance between two points is (x1 - x2)^2 + (y1 - y2)^2. (No, you do not have to take the square root to do this problem.) If a and b are the two sides and c the hypotenuse of a right angled triangle then according to the Pythogorean theorem a^2 + b^2 = c^2.
Your code should have a header with following information on it:
File Name:
Purpose:
Author:
Date Created:
If you are not familiar with the java.util.StringTokenizer class, you should look at the online documentation at http://java.sun.com/j2se/1.4.2/docs/api/index.html and read the description in the textbook on pp 377-378.
This program must be submitted electronically (using the turnin
program)
in a file called prog1.java by the beginning of class on the due date.