Write a program that prompts the user for two points in the x-y plane. Input should be entered in the following order:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question

Let l be a line in the x-yplane. If l is a vertical line, its equation is x = a for some real number a.

Suppose l is not a vertical line and its slope is m. Then the equation of l is y = mx + b, where b is the y-intercept.

If l passes through the point (x₀, y₀), the equation of l can be written as y - y₀ = m(x - x₀).

If (x₁, y₁) and (x₂, y₂) are two points in the x-y plane and x₁ ≠ x₂, the slope of line passing through these points is m = (y₂ - y₁)/(x₂ - x₁).

Instructions

Write a program that prompts the user for two points in the x-y plane. Input should be entered in the following order:

  • Input x₁
  • Input y₁
  • Input x₂
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
Probability Problems
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
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