3. The slope m of a straight line that passes through two points P1(x1, y1) and P2(x2, y2) is calculated using the formula: - X - X Write a C++ program to perform the following tasks: 1. Read from an...


3. The slope m of a straight line that passes through two points P1(x1, y1) and<br>P2(x2, y2) is calculated using the formula:<br>-<br>X - X<br>Write a C++ program to perform the following tasks:<br>1. Read from an input file the coordinates of 2 points for an unknown number of straight<br>lines (until the end of the input file). Each input line contains 4 real values x, Y Xaand<br>ya for ONE straight line.<br>2. For each straight line, a function (called Slope) calculates the slope m using the above<br>formula. The function accepts the values x yu Kand ya as parameters and returns the<br>value of the slope m.<br>Slop.tt x lab9 Eve1.cpp<br>1 2 3 4<br>-1 3 2 5<br>2 -4 5 0<br>Cwindowslaystemazomdee<br>X1 Y x2 va slop<br>1 2<br>2<br>3 4 1.0<br>s0.7<br>• 1.3<br>2<br>4<br>3333<br>3 3<br>3<br>2 -1 -1 -3<br>-1 -3 -4 -1<br>2 -1 -1 -3 0.7<br>-1 -0.7<br>ress any key to continue .<br>-1<br>-3<br>4<br>

Extracted text: 3. The slope m of a straight line that passes through two points P1(x1, y1) and P2(x2, y2) is calculated using the formula: - X - X Write a C++ program to perform the following tasks: 1. Read from an input file the coordinates of 2 points for an unknown number of straight lines (until the end of the input file). Each input line contains 4 real values x, Y Xaand ya for ONE straight line. 2. For each straight line, a function (called Slope) calculates the slope m using the above formula. The function accepts the values x yu Kand ya as parameters and returns the value of the slope m. Slop.tt x lab9 Eve1.cpp 1 2 3 4 -1 3 2 5 2 -4 5 0 Cwindowslaystemazomdee X1 Y x2 va slop 1 2 2 3 4 1.0 s0.7 • 1.3 2 4 3333 3 3 3 2 -1 -1 -3 -1 -3 -4 -1 2 -1 -1 -3 0.7 -1 -0.7 ress any key to continue . -1 -3 4

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here