Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started