Advertisement
Guest User

Untitled

a guest
May 28th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. class Triad
  2. {
  3.     double x,y,z;
  4. public:
  5.     Triad() {}
  6.     Triad(double _x,double _y,double _z):x(_x),y(_y),z(_z) {}
  7.     void Get(double & xx,double &yy,double &zz) {xx=x;yy=y;zz=z;}
  8.     virtual void Set(double xx,double yy,double zz) {x=xx;y=yy;z=zz;}
  9. };
  10. class Triangle : public Triangle
  11. {
  12. public:
  13.     class BadSideLengthException {};
  14.     Triangle() {}
  15.     bool bad_sides(double xx,yy,zz,)
  16.     {
  17.         return (x<0 || y<0 || z<0 || x>y+z || y>x+z || z>x+y);
  18.     }
  19.     Triangle(double _x,double _y,double _z):Triad(_x,_y,_z) {if (bad_sides(_x,_y,_z)) throw BadSideLengthException;}
  20.     virtual void Set(double &xx,double &yy,double &zz)
  21.     {
  22.         if(bad_sides(xx,yy,zz))
  23.             throw BadSideLengthException;
  24.         x = xx;
  25.         y = yy;
  26.         z = zz;
  27.     }
  28.     double GetSquare()
  29.     {
  30.  
  31.     }
  32.     double GetAngleX()
  33.     {
  34.     }
  35.         double GetAngleY()
  36.     {
  37.     }
  38.             double GetAngleZ()
  39.     {
  40.     }
  41. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement