Reference no: EM132419721
Write a program that determines whether two straight lines are perpendicular. The program must prompt the user for the values of x-y coordinates for two points of each line.
For example, in the graph below, the line is defined by the pairs: (15,10) and (49, 25); whereas the line is defined by (29, 5) and (32, 32). Again, these values are to be read from the keyboard.
The program should also avoid a "divide by zero error" by checking for horizontal lines. Also, if one of the lines is horizontal, simply check to see if the other one is vertical to determine whether they are perpendicular.
Output
The program output should be either:
"Lines are perpendicular"
Or
"Lines are not perpendicular"
Attachment:- Programming Project.rar