Question: Create a class called Line that has the following attributes: Line slope - Double yIntersect - Double Line() Line(x_one, y_one, x_two, y_two) getSlope() - Double

Create a class called Line that has the following attributes: 
Line

slope - Double
yIntersect - Double

Line()
Line(x_one, y_one, x_two, y_two)
getSlope() - Double
getYIntersect() - Double
isPointOnLine(xValue, yValue) - Boolean
toString() - String

Notes:

Your isPointOnLine() method should return true if a given point falls on the given line. In all other cases, return false.


then:


Create a class called Point that has the following attributes:

Point

xValue- Double
yValue- Double

Point()
Point(xValue, yValue)
getXValue() - Double
getYValue() - Double
toString() - String


then:

Create a class called LineSegment that has the following attributes:

LineSegment

slopeIntercept - Line
startXValue - Double
endXValue - Double

LineSegment ()
LineSegment (slopeIntercept, startXValue, endXValue)
getSlope() - Double
getLength() - Double
isPointOnLine(Point) - Boolean
toString() - String

Notes:

You should use standard calculations to return slope and length. Both of these values should be accurate to 4 decimal places.

The method isPointOnLine(Point) will accept a point and return true if it falls on the line segment, and false otherwise.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the implementation of the three classes in Java import javatextDecimalFormat class Line privat... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!