Skip to content

mwagner86/CPP_04

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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