Advertisement
molendzik

punkt.h

Nov 24th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.19 KB | None | 0 0
  1. //punkt.h
  2.  
  3. #include <vector>
  4. #include <iostream>
  5.  
  6. using std::vector;
  7. using namespace std;
  8.  
  9. class Punkt{
  10.  
  11.     protected:
  12.     vector<double> posX;
  13.     vector<double> posY;
  14.     vector<int> liczbaWymiarow;
  15.  
  16.     public:
  17.     Punkt();
  18.     Punkt(double, double);
  19.     Punkt(const Punkt &punkt){
  20.         posX = punkt.posX;
  21.         posY = punkt.posY;
  22.     }
  23.  
  24.     double GetPunktX(int);
  25.     double GetPunktY(int);
  26.     void SetPunktX(int, double);
  27.     void SetPunktY(int, double);
  28. };
  29.  
  30. class Figura : public Punkt{
  31.  
  32.     vector<Punkt> liczbaWierzcholkow;
  33.  
  34.     public:
  35.  
  36.     void DodajPunkt(double, double);
  37.     Figura();
  38.     double ObliczObwod(int jakafigura);
  39.     virtual double ObliczPole(){
  40.         cout << "xd";
  41.         return 0;
  42.     }
  43. };
  44.  
  45. class Kwadrat : public Figura{
  46.     int jakafigura;
  47.  
  48.     public:
  49.     Kwadrat();
  50.     virtual double ObliczPole();
  51.     int GetFigura();
  52.     void SetFigura(int);
  53. };
  54.  
  55. class Trojkat : public Figura{
  56.     int jakafigura;
  57.  
  58.     public:
  59.     virtual double ObliczPole();
  60. };
  61.  
  62. class Trapez : public Figura{
  63.     int jakafigura;
  64.  
  65.     public:
  66.     Trapez();
  67.     virtual double ObliczPole();
  68.     int GetFigura();
  69.     void SetFigura(int);
  70. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement