Coding Challenge: Modeling a Dog

Let's create a Dog object and implement some of its methods.

We'll cover the following

Problem statement

Create a Dog object with the following properties:

  • A name property is set to “Tim”
  • A species property is set to “German Shepherd”
  • A size property is set to “3 foot”
  • describe() - returns “Tim belongs to German Shepherd species and its size is 3 foot”
  • bark() - returns “Woof!”

Try to solve it on your own and if you get stuck anywhere, you can always refer to the solution.

Coding exercise

Get hands-on with 1200+ tech skills courses.