/cpp03

I explored different types of inheritance, such as single, multiple, and virtual, enabling flexible code reuse

Primary LanguageC++

C++ Module 03

This module focuses on inheritance in C++, using a hierarchy of robot classes (ClapTrap, ScavTrap, FragTrap, DiamondTrap) and introducing multiple inheritance challenges.


πŸ› οΈ Usage

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

πŸ“‚ ex00

cd ex00
make
./claptrap

πŸ“‚ ex01

cd ex01
make
./scavtrap

πŸ“‚ ex02

cd ex02
make
./fragtrap

πŸ“‚ ex03

cd ex03
make
./diamondtrap

πŸ“ Exercise Descriptions

ex00 β€” Aaaaand... OPEN!: Implement the ClapTrap class with name, hit points, energy points, and attack damage. Add attack, takeDamage, and beRepaired behaviors.

ex01 β€” Serena, my love!: Add the ScavTrap class, inheriting from ClapTrap, with unique messages and a guardGate() ability.

ex02 β€” Repetitive work: Add the FragTrap class, also inheriting from ClapTrap, with a highFivesGuys() special function.

ex03 β€” Now it’s weird!: Introduce DiamondTrap, using multiple inheritance from both ScavTrap and FragTrap. Add a private name and a whoAmI() function to show its identity.

πŸ’Ό 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).