Animal Farm Class Hierarchy Visualization
This project implements a comprehensive animal management system in C++, showcasing Object-Oriented Programming (OOP) principles and software engineering best practices. You can find the complete source code on GitHub.
The Animal Farm project demonstrates several key programming concepts:
The project features a robust class hierarchy where each class has specific responsibilities:
Animal
: Base class providing core attributes like weight, genderMammal
: Extends Animal with mammal-specific features like colorCat
: Concrete class with cat-specific attributes and behaviorsSome example of the object in Animal Farm :
class classCat : public classMammal {
protected:
///// Protected Attributes /////
string name ;
bool isCatFixed = false ;
///// Protected Attributes /////
public:
///// Static Public Attributes /////
static const string SPECIES_NAME ;
static const classWeight::t_weight MAX_WEIGHT ;
///// Static Public Attributes /////
public:
///// Constructor /////
classCat( const string &NewName ) ;
classCat( const string &NewName,
const Color newColor,
const bool newIsFixed,
const Gender newGender,
const classWeight::t_weight newWeight ) ;
///// Constructor /////
public:
///// Getters /////
string getName() const noexcept ;
bool isFixed() const noexcept ;
///// Getters /////
///// Setters /////
void setName ( const string &NewName ) ;
void fixCat () noexcept ;
///// Setters /////
public:
///// Static Public Member Function /////
static bool validateName( const string &NewName ) ;
///// Static Public Member Function /////
public:
///// Validation & Print /////
string speak () const noexcept override ;
void print () const noexcept override ;
bool validate () const noexcept override ;
///// Validation & Print /////
public:
///// Debug Print /////
void debugPrint() const noexcept override ;
///// Debug Print /////
};
Through this project, I gained experience in: