mariotourist

Untitled

Dec 21st, 2021
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. //Progres.h
  2. #pragma once
  3. #ifndef PROGRES_H
  4. #define PROGRES_H
  5. #include <iostream>
  6. #include <cmath>
  7. #include <cassert>
  8. using namespace std;
  9.  
  10. //оставляю первый член, остальное в наследники
  11. class Series {
  12. protected:
  13.     double m_first;
  14.     double m_second;
  15. public:
  16.     virtual double Sum(int) = 0;
  17.     virtual double SerJ(int ) = 0;
  18. };
  19.  
  20. class Exponential : public Series {
  21.     double m_coef;
  22. public:
  23.  
  24.     Exponential(double, double);
  25.     Exponential();
  26.     double Sum(int);
  27.     double SerJ(int);
  28.     friend std::ostream& operator<< (std::ostream& out, const Exponential& exponential);
  29. };
  30.  
  31. class Linear : public Series {
  32.     double m_coef;
  33. public:
  34.     Linear(double, double);
  35.     Linear();
  36.  
  37.     double Sum(int);
  38.     double SerJ(int);
  39.     friend std::ostream& operator<< (std::ostream& out, const Linear& linear);
  40.  
  41. };
  42.  
  43.  
  44.  
  45.  
  46. #endif
Add Comment
Please, Sign In to add comment