Question: 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

 Write a complete webpage with embedded JavaScript code to create a

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 numberOfSides: integer o perimeter: real number (number with decimal places) o area: real number Methods o display): 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 display0: no return, print out current values of all properties of this object with innerHTML o eat0: 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

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!