Finding Intersections of Lines

Write a class named IntersectionOfLinesFinder whose main method prompts the user for the values of $A,B,C,D,E,$ and $F$, and then finds the point of intersection (as it exists) of the following lines $$\begin{array}{c} Ax+By=C\\ Dx+Ey=F \end{array}$$ The point of intersection should be displayed in the form of an ordered pair $(x,y)$, where both $x$ and $y$ are displayed approximated to two decimal places. If the equations represent the same line, or parallel lines, the output should indicate this, as shown in the sample runs below.

Sample run 1:

This program finds the intesection of lines Ax+By=C and Dx+Ey=F
---------------------------------------------------------------
Enter the values of A, B, and C (separated by spaces): 3 4 5
Enter the values of D, E, and F (separated by spaces): 2 -1 -7
The point of intersection is approximately (-2.09,2.82)

Sample run 2:

This program finds the intesection of lines Ax+By=C and Dx+Ey=F
---------------------------------------------------------------
Enter the values of A, B, and C (separated by spaces): 3 4 5
Enter the values of D, E, and F (separated by spaces): 6 8 13
There is no point of intersection -- these lines are parallel

Sample run 3:

This program finds the intesection of lines Ax+By=C and Dx+Ey=F
---------------------------------------------------------------
Enter the values of A, B, and C (separated by spaces): 3 4 5
Enter the values of D, E, and F (separated by spaces): 6 8 10
These two equations represent the same line.

Tags: java.util.Scanner, if-else, printf()