Question: write code in c + + You are provided with the co - ordinates of three points, 2 ) and C ( x 3 ,

write code in c++You are provided with the co-ordinates of three points,
2) and C(x3,y3).AB is a directed segment. So imagine you are walking
along the directed line segment AB. Is point C to your left? On the sam
e line of your walk? Or to your right? Answer LEFT, SAME or RIGHT corr
espondingly.
Input
Three lines of input. Each line has 2 integers separated by a white spa
ce, representing the x-coordinate and y-coordinate of a point.
The first line of input is x 1 y 1(point A ).
The second line of input is x 2 y 2(point B).
The third line of input is x3y3(point C).
Output
One line of output as text.
LEFT if C is on the left of directed segment AB.
SAME if C is on line AB.
RIGHT if C is on the right of directed segment AB.
Sample Input 1
Sample Output 1
Hint
Sampe 1
(3,4) is on the left of directed line segment AB when A=(0,0) and B=(6,6).
(-2,-2) lies on the line AB when A=(0,0) and B=(6,6).
write code in c + + You are provided with the co

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!