Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed 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

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

Students also viewed these Databases questions