Answered step by step
Verified Expert Solution
Question
1 Approved Answer
THIS NEEDS TO BE DONE IN JAVASCRIPT, IT IS FOR HTML, CSS, JS CLASS 6. This question is worth 10 points. Using modules, create a
THIS NEEDS TO BE DONE IN JAVASCRIPT, IT IS FOR HTML, CSS, JS CLASS
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, completeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started