Question: Implementing a Subclass and Abstract methods Csc 1351-o3,os, spring 2017, Lab 3: Project Triangle Implementing a subclass and Abstract Methods mmermance me process by class

Implementing a Subclass and Abstract methods
Implementing a Subclass and Abstract methods Csc 1351-o3,os, spring 2017, Lab 3:
Project Triangle Implementing a subclass and Abstract Methods mmermance me process by

Csc 1351-o3,os, spring 2017, Lab 3: Project Triangle Implementing a subclass and Abstract Methods mmermance me process by class trope), the dernvedelass, defined rone Dennirion 1. the superouass and the new class (type) erase an Java cosmic cuasa than is, every class class As cawed a nubelass. The object wil mmerits the otyeet class. In today's lab session, you onnee classes. Powygon, a superaass that describes a polygon, Triangle, a subclass e Abygon class, and to test your mplementation of the superchas" The Polygon Class Definition 2. A polygon can be defined as a geometric object consisting of a number of points (ca ea vertices, and an equal number of me segments (called sides), namely a cyclically or dered set ofpoints m a plane, with no three successive points colinear, together with the line segments/oining consecutive pairs of one points. The Polygon class wim consist of an array of type Polnt2D Double, named vertices, as its instance variable. This class will be an abstract class. View the online Java API documentation to find the package in which Point2DDouble is defined. When declaring the instance variable Vertices, use the protected access specifier. This class will consist of the following methods 1. public Polygon a default constructor that sets vertices to mull. 2. pubic Polygon Point2D Doublell points): a parameterized constructor that takes an array of points as an explicit parameter and creates a polygon. 3. protected static double distance(Point2D Double p1, Polnt2D.Double p2) an auxilliary method used to find the Euclidean distance between two points. Given points pi (r1.vi) and (r2 ur), the Euclidean distance between them is given by the formula: 4. abstract public double area0. an abstract method which when implemented computes the area of the polygon 5. public double perimeter): an instance method that computes the perimeter of the polygon

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!