Category : abstract-class

I have a base product class with a few private members and a public getter that derived classes inherit. I would like to disqualify instantiation, since the class is intended for use with an abstract factory. I thought protected con/destructors might work, however, this breaks my smart pointers. Friending seems like a useful disaster. Is ..

Read more

which is the best way to input the parameters? and then to display them together with "sum". The condition was to use virtual functions / abstract classes. #include <iostream> using namespace std; class progression { protected: double a0; double r; virtual void sum(int) = 0; }; class ARITHprogression: public progression { double g_suma(int n) { ..

Read more