Let l be a line in the x-y plane. If l is a vertical line, its equation is x 5a for some real number a. Suppose l is not a vertical line and its slope is m. Then the equation of l is y 5mx 1b, where b is the y-intercept. If l passes through the point (x0, y0,), the equation of l can be written as y 2y0 5m(x 2x0 ). If (x1, y1) and (x2, y2) are two points in the x-y plane and x1 ≠ x2, the slope of line passing through these points is m 5(y2 2y1 )/(x2 2x1 ). Write a program that prompts the user two points in the x-y plane. The program outputs the equation of the line and uses if statements to determine and output whether the line is vertical, horizontal, increasing, or decreasing. If l is a non-vertical line, output its equation in the form y 5mx 1b.

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter12: Review Of Calculus And Probability
Section12.5: Random Variables, Mean, Variance, And Covariance
Problem 5P
icon
Related questions
Question

Let l be a line in the x-y plane. If l is a vertical line, its equation is x 5a for some real number a. Suppose l is not a vertical line and its slope is m. Then the equation of l is y 5mx 1b, where b is the y-intercept. If l passes through the point (x0, y0,), the equation of l can be written as y 2y0 5m(x 2x0 ). If (x1, y1) and (x2, y2) are two points in the x-y plane and x1 ≠ x2, the slope of line passing through these points is m 5(y2 2y1 )/(x2 2x1 ). Write a program that prompts the user two points in the x-y plane. The program outputs the equation of the line and uses if statements to determine and output whether the line is vertical, horizontal, increasing, or decreasing. If l is a non-vertical line, output its equation in the form y 5mx 1b.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Time complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning