Advertisement
serikov

Untitled

Jun 23rd, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. class QuartzClock {
  2.    public:
  3.       QuartzClock(Time* t);
  4.  
  5.       float GetAngle() {
  6.         angle = 0;
  7.         int hours = this->t = t.GetHours();
  8.         if (hours>12) hours = hours - 12;
  9.         int minutes = this->t.GetMinutes();
  10.         angle = abs(hours*30-minutes*6); if (angle>180) angle=abs(180-angle);
  11.         return angle;
  12.         }
  13.  
  14.     private:
  15.         float angle;
  16.         Time t;
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement