Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

Can users tab from one form-field to the next?

Answered: 1 week ago