Skip to content

Introduction to subtype polymorphism, abstract classes and interfaces

Notifications You must be signed in to change notification settings

jakobsitory/04_CPP04_42CC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Module 04

This repository contains solutions to various C++ programming challenges from the 42 School curriculum. Each module is designed to deepen students' understanding of different programming concepts and techniques.

Exercises

ex00 - Polymorphism

A class hierarchy to demonstrate the concept of polymorphism in C++.

Key objectives included:

  • Implementing a base class and derived classes.
  • Demonstrating runtime polymorphism using virtual functions.
  • Understanding the use of pointers and references to base class objects.

ex01 - I don’t want to set the world on fire

A class that simulates a fire-related scenario using polymorphism.

Key objectives included:

  • Implementing a class hierarchy with fire-related classes.
  • Demonstrating polymorphism through virtual functions.
  • Managing resources and state within the class hierarchy.

ex02 - Abstract class

An abstract base class and derived classes to demonstrate the use of abstract classes in C++.

Key objectives included:

  • Implementing an abstract base class with pure virtual functions.
  • Creating derived classes that override the pure virtual functions.
  • Demonstrating the use of abstract classes and polymorphism.

ex03 - Interface & recap

Interfaces and implementing them in derived classes, along with a recap of previous concepts.

Key objectives included:

  • Implementing interfaces using abstract classes.
  • Creating derived classes that implement the interfaces.
  • Recapping and demonstrating the use of polymorphism, inheritance, and abstract classes.

Installation

To install the project, follow these steps:

  1. Clone the repository: git clone git@github.com:jakobsitory/04_CPP04_42CC.git
  2. Navigate to the project directory: cd 04_CPP04_42CC
  3. Navigate to the exercise directory : cd ex00, cd ex01 ...
  4. Build the project: make

Usage

Follow the on-screen instructions to run program.

ex00 - ex02

./AnimalFarm

ex03 - Interface & recap

./Interface

About

Introduction to subtype polymorphism, abstract classes and interfaces

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published