Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a class called Line that represents a line segment between two points. Your line object should have the following method: NOTE;(EVERY) line of code

Write a class called Line that represents a line segment between two points. Your line object should have the following method:

NOTE;(EVERY) line of code written has to have comments to it

Public Line(Point p1, Point p2)

Constructs a new line that contains the given two Points.

Public Point getP1()

Returns this Lines first endpoint

Public Point getP2()

Returns this line second ndpoint

Public String toString()

Returns a String representation of this Line, such as [(22, 3), (4, 7)]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What does this feeling remind you of?

Answered: 1 week ago

Question

What options do you have?

Answered: 1 week ago

Question

What would success look like to you?

Answered: 1 week ago