Line - yOne = y1; xTwo = x2; yTwo = y2; } public void...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//© A+ Computer Science - www.apluscompsci.com //Name - //Date - //Lab - public class Line { private double xOne,yOne, xTwo, yTwo; private double slope; public void setCoordinates(double x1, double y1, double x2, double y2) { xOne = x1;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: yOne = y1; xTwo = x2; yTwo = y2; } public void calculateSlope( ) { slope = (yTwo-yOne)/(xTwo-xOne); } public void print( ) { System.out.printf(" The slope is " + "%.2f\n",slope); System.out.println(); } }...
View Full Document

Ask a homework question - tutors are online