JAVA

profiley93

java 


Design a class named StraightLine for a linear equation ax + by + c = 0. The class contains: • Private data fields a, b and c that represents three coefficients. • A constructor with the arguments for a, b and c. • Three getter methods for a, b and c. • A method named getXIntercept() that returns the x-intercept of the straight line given by the equation ax + by + c = 0. • A method named getYIntercept() that returns the y-intercept of the straight line given by the equation ax + by + c = 0. • A method named getYcoordinate(double Xcoordinate) that takes x-coordinate of a point on the line ax + by + c = 0 as input and returns the y-coordinate of that point.

  • 8 years ago
  • 20
Answer(3)

Purchase the answer to view it

blurred-text
NOT RATED

Purchase the answer to view it

blurred-text
NOT RATED

Purchase the answer to view it

blurred-text
NOT RATED
  • attachment
    StraightLine.java