PART A: Recall that a Line is defined by two Points in the (x, y) plane. Write class Line where one object represents a Line; the Line object is stored as two Point objects, start and end. Define appropriate instance variables and the following instance methods: init__() sets the initial values for start and end to the two Point objects that are passed in through its parameters. Assume that the caller (e.g. main) passes in two Point objects to this method (i.e. no error checking required.) __str__() returns a string representation of the object that calls it. PART B: Write an additional method for class Line: length() method returns the length of the line. Recall that the length of a line with start point (startX, startY) and end point (endX, endY) is: square root of ( (startX-endX)2 + (startY-endY)2 ) ) PART C: Write a main program that thoroughly tests class Line from the previous two PARTS. Please submit all parts separately, not as one whole program. Thank You!

Leave a Reply

Your email address will not be published. Required fields are marked *