123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #include <iostream>
- #include <string>
- #include <typeinfo>
- using namespace std;
-
-
- #ifndef FIGURES_HEADER
- #define FIGURES_HEADER
-
- class coloriable{
- protected :
- string couleur;
-
- public :
- coloriable();
- coloriable(string coul);
- string getCouleur();
- void setCouleur(string coul);
- };
-
- class figure{
-
- protected :
- static int nb_instances;
-
- public :
- virtual float perimetre()=0;
- virtual void afficherCaracteristiques()=0;
- figure();
- static int get_nbInstances();
- };
-
- class cercle : public figure , public coloriable{
- private :
- float rayon;
-
- public:
- cercle();
- cercle(float rayon, string coul);
- virtual void afficherCaracteristiques();
- virtual float perimetre();
- float get_rayon();
- void set_rayon(float ray);
- };
-
- class polygone : public figure{
- private :
- int nb_cotes;
-
- public:
- polygone();
- polygone(int nbc);
- virtual void afficherCaracteristiques();
- virtual float perimetre()=0;
-
- };
-
- class rectangle : public polygone{
- protected :
- float cote_1;
- float cote_2;
- public :
- rectangle();
- rectangle(float cot1, float cot2);
- void set_cote_1(float cot1);
- void set_cote_2(float cot2);
- float get_cote_1();
- float get_cote_2();
- virtual float perimetre();
- void afficherCaracteristiques();
- };
-
- class carre : public rectangle{
- public :
- carre();
- carre(float cote);
- void afficherCaracteristiques();
- };
-
-
-
- class triangle : public polygone{
- protected :
- float cote;
- public :
- triangle();
- triangle(float cot);
- void set_cote(float cot1);
- float get_cote();
- virtual float perimetre();
- void afficherCaracteristiques();
- };
- #endif
|