CS 135
Exercise #7
Point value: 40
Date due:
email source file (using mail utility) to your lab instructor by 11:59pm Fri, Oct 6

New Skills Practiced (Learning Goals)
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.

If P1 = (x1,y1) and P2 = (x2,y2) then slope = (y2-y1)/(x2-x1)

If the slope is
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
When the program compiles and runs correctly on bobby.cs.unlv.edu, use the mail utility to email a copy of the program file to your lab instructor. Make sure the subject line of your email includes your name, lecture and lab section #s, and the exercise # if you wish to receive full credit.

NOTES:

Sample terminal session:
[lee@bobby keys]$ g++ exercise07.cpp
[lee@bobby keys]$ ./a.out
Lee Misch  Lec#10__  Lab#10__  Exercise #7
Please enter the x and y coordinates for point 1: -2 7
Please enter the x and y coordinates for point 2: 3 -5
Point 1: (-2,7)
Point 2: (3,-5)
Slope = -2.4000
The line defined is decreasing.
[lee@bobby keys]$ ./a.out
Lee Misch  Lec#10__  Lab#10__  Exercise #7
Please enter the x and y coordinates for point 1: 4 5
Please enter the x and y coordinates for point 2: 4 3
Point 1: (4,5)
Point 2: (4,3)
The line defined is vertical.
[lee@bobby keys]$ ./a.out
Lee Misch  Lec#10__  Lab#10__  Exercise #7
Please enter the x and y coordinates for point 1: -1 3
Please enter the x and y coordinates for point 2: -1 3
Point 1: (-1,3)
Point 2: (-1,3)
Point 1 and 2 are the same. No line defined.