Category : oop

#define _USE_MATH_DEFINES #include <cmath> #include <iostream> using namespace std; class Circle{ public: void set(float number){ radius = number; } protected: float radius; }; class Area : public Circle{ public: float getArea() { return (M_PI*(radius*radius)); } }; class Circumference:public Circle{ public: float getCircumference() { return ((2*M_PI)*radius); } }; class Diameter : public Circle{ public: float getDiameter() ..

Read more

Hello I’m always getting an error when i do overloading can someone please explain my error here. Main file: #include <iostream> #include <string> #include "couche.hpp" using namespace std; int main(){ Couche C(5.2,6.3); cout<< C.get_lambda(); std::cout<< C; } .hpp file: #include <string> using namespace std; class Couche{ private: double epaisseur; double lambda; public: // constructeur: Couche(double ..

Read more