A+ Computer Science SLOPE OF A LINE
Lab Goal : This lab was designed to teach parameter passing, value calculation, and output.
Lab Description : Calculate the slope of a line when given 2 points.
The formula for the slope of a line is as follows :: m = ( y2-y1 )/( x2-x1 )
Sample Data: Files Needed ::
1 9 14 2
1 7 18 3 [Link]
6 4 2 2
4 4 5 3
1 1 2 9
1 7 2 9
Sample Output :
Slope is :: -0.54
Slope is :: -0.24
Slope is :: 0.50
Slope is :: -1.00
Slope is :: 8.00
Slope is :: 2.00
© A+ Computer Science – OOP/Vars/Math – [Link]