Question: Hello Help C++ Question: Given the x and y coordinates of 2 different points, the slope of the line (unless it is vertical) defined by

Hello Help C++ Question:

Given the x and y coordinates of 2 different points, the slope of the line (unless it is vertical) defined by the points can be computed as shown below.

Hello Help C++ Question: Given the x and y coordinates of 2

If the slope is

equal to 0, then the line is horizontal

positive, then the line is increasing

negative, then the line is decreasing If the slope is not defined (cannot be computed) the line is vertical.

If the 2 points are the same, they do not define a line.

Design and implement a complete C++ program that will

display your name, lecture and lab section #s, and exercise #

interactively prompt for and read 2 integers that represent the x and y coordinates of P1

interactively prompt for and read 2 integers that represent the x and y coordinates of P2

display (to the screen) the input values with appropriate labels and an appropriate message that indicates whether the points define a line

if they define a line,

the line's slope (except for vertical lines)

what type of line (horizontal, vertical, increasing, or decreasing)

an increasing line has a positive slope

a decreasing line has a negative slope

display slopes with 4 digits to the right of the decimal

Assume that the 4 input values will be integers (positive, negative, or zero).

Choose appropriate data sets to test your program. The 3 samples shown below are NOT enough to verify that the program meets all requirements.

different points, the slope of the line (unless it is vertical) defined

If P1=(xi.y.) and = (X2,Y2) =(x2-y1) P then slope

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!