Skip to content
/ cpp04 Public

About subtype polymorphism, abstract classes, and interfaces to enhance code flexibility and design

Notifications You must be signed in to change notification settings

ngtina99/cpp04

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

21 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

C++ Module 04

This module explores subtype polymorphism, abstract classes, and interfaces in C++. You will build an inheritance tree of animals and magical materia systems to practice virtual functions, deep copies, and multiple inheritance concepts.

๐Ÿ› ๏ธ Usage

For each exercise, navigate to its folder, compile, and run:

๐Ÿ“‚ ex00

cd ex00
make
./ex00

๐Ÿ“‚ ex01

cd ex01
make
./ex01

๐Ÿ“‚ ex02

cd ex02
make
./ex02

๐Ÿ“ Exercise Descriptions

ex00 โ€” Polymorphism: Create an Animal base class, with derived Dog and Cat classes. Demonstrate virtual functions and subtype polymorphism. Include a WrongAnimal / WrongCat example to show the effect without virtual functions.

ex01 โ€” I donโ€™t want to set the world on fire: Add a Brain class to Dog and Cat for deep copy tests. Manage dynamic memory carefully to avoid leaks.

ex02 โ€” Abstract class: Make Animal an abstract base class to prevent direct instantiation. Keep polymorphic behavior intact.

๐Ÿ’ผ Connect

If you have any questions or suggestions, feel free to connect: ๐Ÿ”— LinkedIn: Valentina Nguyen ๐Ÿ™‹โ€โ™€๏ธ

๐Ÿ–ฅ๏ธ System Compatibility

This project was developed and tested on Linux (Ubuntu).

About

About subtype polymorphism, abstract classes, and interfaces to enhance code flexibility and design

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published