0% found this document useful (0 votes)
3 views1 page

Calculate Slope from Two Points

The lab focuses on teaching parameter passing, value calculation, and output by calculating the slope of a line using the formula m = (y2-y1)/(x2-x1). Sample data is provided along with the required file, LineRunner.java, to perform the calculations. The output demonstrates various slope values calculated from given points.

Uploaded by

ilovedog19815
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Calculate Slope from Two Points

The lab focuses on teaching parameter passing, value calculation, and output by calculating the slope of a line using the formula m = (y2-y1)/(x2-x1). Sample data is provided along with the required file, LineRunner.java, to perform the calculations. The output demonstrates various slope values calculated from given points.

Uploaded by

ilovedog19815
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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]

You might also like