Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( Geometry: the Triangle 2 D class ) Define the Triangle 2 D class that contains: Three points named p 1 , p 2 ,

(Geometry: the Triangle2D class) Define the Triangle2D class that contains: Three points named p1, p2, and p3 of the type MyPoint with getter andsetter methods. MyPoint is defined in Programming Exercise 10.4. A no-arg constructor that creates a default triangle with the points (0,0),(1,1), and (2,5). A constructor that creates a triangle with the specified points. A method getArea () that returns the area of the triangle. A method getPerimeter () that returns the perimeter of the triangle. A method contains (MyPoint p) that returns true if the specified pointp is inside this triangle (see Figure 10.22a). A method contains (Triangle2D t) that returns true if the specifiedtriangle is inside this triangle (see Figure 10.22b). A method overlaps (Triangle2D t) that returns true if the specifiedtriangle overlaps with this triangle (see Figure 10.22c).

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

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

Describe the pros and cons of five management development methods.

Answered: 1 week ago

Question

=+8. Why is productivity important?

Answered: 1 week ago

Question

=+ 9. What is inflation and what causes it?

Answered: 1 week ago