Question: 6. This question is worth 10 points. Using modules, create a class called Polygon. It has the following attributes: - name (default is 'unknown') -

 6. This question is worth 10 points. Using modules, create a

6. This question is worth 10 points. Using modules, create a class called Polygon. It has the following attributes: - name (default is 'unknown') - height - width It will have the following functions: - toString() - this function returns a string that starts with " Hi. I am an instance of (name) - My height is [height] and my width is [width]" - getHistory() - this function returns: "Polygon is derived from the Greek polus (many) and gonia (angle)." - getArea() - this function returns 0.00 by default. Next, create another class that is a subclass of Polygon, called Square. It does not have any of its own attributes. It will have the following functions: - getArea() - this function returns the area of a square. - getHistory() - this function returns: "Square means in Latin: to set in order, complete

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!