Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 712 Bytes

README.md

File metadata and controls

22 lines (17 loc) · 712 Bytes

CPP_04

Subtype polymorphism, abstract classes, interfaces

Exercise 00:

Polymorphism

Start by implementing a simple base class called Animal. It has one protected attribute

Exercise 01:

I don’t want to set the world on fire

Constructors and destructors of each class must display specific messages.

Exercise 02:

Abstract class

Creating Animal objects doesn’t make sense after all. It’s true, they make no sound!

Exercise 03:

Interface & recap

Interfaces don’t exist in C++98 (not even in C++20). However, pure abstract classes are commonly called interfaces. Thus, in this last exercise, let’s try to implement interfaces in order to make sure you got this module