Question: Write a program that will accept the x and y coordinates of two points on a line. Then take in another coordinate and test whether

Write a program that will accept the x and y coordinates of two points on a line. Then take in another coordinate and test whether its on the line or not. Remember, the equation of a line is

y = mx + b (or equivalently b = y mx) and slope is m = (y2 y1)/(x2 x1).

Sample input: Enter two points on a line:

x1: 0

y1: 2

x2: 2

y2: 6

Enter a point:

j: 5

k: 8

Sample output: The point (5,8) is NOT on the line y=2*x+2

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 Databases Questions!