Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Using the code from Module 5 , make the following changes: Modify the myGreeting method to display whether the dog can talk. Use a

Instructions
Using the code from Module 5, make the following changes:
Modify the myGreeting method to display whether the dog can talk. Use a conditional statement to determine if the dog can talk.
Hint: Evaluate the canTalk value. Modify the displayed message to include I can talk! or I cannot talk depending on the value of canTalk. The this keyword will help with this task.
Call the myGreeting method to display if the dog can talk.
You will now use a constructor function to define a dog object and then pass values to it to create new objects. Create a constructor to define the objects properties using the same properties you used to create the myDogConst.
Call the constructor function to create two new dog objects from the fictional dogs Wikipedia site
List of fictional dogs in animated television
Use a for ... in loop to display each property and value in the object appropriately labeled.
Prompt the user to select one of the dogs by typing in one of the dogs names.
Next, you will display the selected dog and provide all the information you have about that dog. Use the dogs myGreeting method to retrieve the message and display it within one of your HTML paragraphs.
If the user selects a dog that isnt in the list, display an error message to let them know the object they selected doesnt exist.

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

More Books

Students also viewed these Databases questions