Animal Farm: Object-Oriented Programming in C++

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.

Project Overview

The Animal Farm project demonstrates several key programming concepts:

Implementation Details

The project features a robust class hierarchy where each class has specific responsibilities:

Some 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 /////
  
 };

Learning Outcomes

Through this project, I gained experience in:

  1. Implementing inheritance and polymorphism in C++
  2. Managing memory in complex data structures
  3. Writing maintainable and documented code
  4. Using development tools like Doxygen for documentation
  5. Applying software engineering principles to a real-world problem

Tools & Technologies