Description
File Name:

H:\CPSC1150\Lab4\Triangle.java 
Purpose

To calculate the perimeter of a triangle by letting the user to enter 3 coordinates by using Pythagoras to solve
. 
Input

xcoordinates 1,2 and 3 and ycoordinates 1,2 and 3 
Output

The perimeter of a triangle 
Program Logic (Pseudocode)
Algorithm Triangle
Start
 Initialize variables
(a) xcoordinate 1 (input) in int
(b) ycoordinate 1 (input) in int
(c) xcoordinate 2 (input) in int
(d) ycoordinate 2 (input) in int
(e) xcoordinate 3 (input) in int
(f) ycoordinate 3 (input) in int
(g) side 1 (calculation) in double
(h) side 2 (calculation) in double
(i) side 3 (calculation) in double
(f) perimeter (output) in double
 Allow the user to enter an input for the x and y coordinates
(a) If any of the x or y coordinates are above 40, let the user know and terminate the program
(b) If any of the x or y coordinates are below 0, let the user know and terminate the program
(c) If all 3 xcoordinates are on the same line, let the user know and terminate. Due to it not being a triangle
(d) If all 3 ycoordinates are on the same line, let the user know and
terminate. Due to it not being a triangle
 Display the perimeter of the triangle
(a) Using Pythagoras = (a^{2}+b^{2})^{1/2} to calculate the length of each side
(b) Calculate the perimeter by adding all 3 sides up
(c) Display to the user
 Ask if the user if he would like to repeat the process
(a) Create a loop with steps 2 and 3, so if the user would like to do another calculation then allow him
(b) Ask the user if he would like to repeat the calculations
 Terminate
(a) When the user does not want to run the program again