Skip to content
/ cpp03 Public

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

Notifications You must be signed in to change notification settings

ngtina99/cpp03

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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).

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published