From the course: Programming Foundations: Design Patterns

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: The Adapter pattern

Challenge: The Adapter pattern

From the course: Programming Foundations: Design Patterns

Start my 1-month free trial

Challenge: The Adapter pattern

(energetic music) - [Instructor] You've just learned how you can use the Adaptor pattern to create an adapter that adapts turkeys to ducks. In this challenge, you are going to create an adapter to adapt a drone to a duck. A drone is a small robot that can fly and is used to take photographs and videos from above. It makes a beeping sound, and it can fly by spinning its rotors and taking off. But the drone's interface is a bit different from the duck interface. So your challenge is to create an adapter for the drone so we can use the drone in the duck simulator. Here's the drone class. Can you create an adaptor class that allows it to run in the simulator?

Contents