Question: View attached JAVA Write a complete webpage with embedded JavaScript code to create a shape object and an alligator object. The shape object has following
View attached JAVA

Write a complete webpage with embedded JavaScript code to create a shape object and an alligator object. The shape object has following components. Properties o o numberOfSides: integer perimeter: real number (number with decimal places) area: real number Methods o displayO: no return, print out current values of all properties of this object with innerHTML o getArea: return the area of this shape object. The alligator object has following components Properties o name: string. We assume this alligator is raised by human. o weight: real number o color: string Methods o displayO: no return, print out current values of all properties of this object with innerHTML o eat: : no return, print out food list of this alligator Create one shape using the object literal and the other using the new operator. The latter must be made from the Object object. Then call all possible methods from each object created. At the minimum, the HTML code should have a heading and a
element that serves as the anchor for the innerHTML output
Step by Step Solution
There are 3 Steps involved in it
To create a webpage with embedded JavaScript code follow these steps Well define a shape object usin... View full answer
Get step-by-step solutions from verified subject matter experts
