Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Recommended Textbook for

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions