This project introduces polymorphism and interfaces in C++ through an Animal class hierarchy, where Dog and Cat inherit from Animal, showcasing polymorphic behavior with the makeSound() method. The exercises build on this by adding abstract classes, deep copying, memory management, and interfaces for managing unique attributes and behaviors.
Objectives π:
- Implement a basic
Animalclass and deriveDogandCatclasses.
Requirements:
- Define
Animalwith protected attributetype. DogandCatinitializetypeas "Dog" or "Cat".- Create
makeSound()for each class to produce specific sounds.
Objectives π:
- Extend
DogandCatwith uniqueBrainobjects.
Requirements:
- Add a
Brainclass with 100std::stringideas. DogandCathave privateBrain*attributes, allocated withnewand deleted on destruction.- Ensure deep copying of
DogandCatobjects.
Objectives π:
- Make
Animalan abstract class.
Requirements:
- Convert
Animalinto an abstract base class, making it non-instantiable. - Derived classes like
DogandCatremain functional.
Objectives π:
- Implement interfaces using abstract classes.
Requirements:
- Create
AMateriawithclone()anduse()as pure virtual methods. - Implement
IceandCureclasses with specificuseactions. - Develop
CharacterandMateriaSourceclasses with inventory and item management features.
