stonewt1.h 773 B

12345678910111213141516171819202122
  1. // stonewt1.h -- revised definition for the Stonewt class
  2. #ifndef STONEWT1_H_
  3. #define STONEWT1_H_
  4. class Stonewt
  5. {
  6. private:
  7. enum {Lbs_per_stn = 14}; // pounds per stone
  8. int stone; // whole stones
  9. double pds_left; // fractional pounds
  10. double pounds; // entire weight in pounds
  11. public:
  12. Stonewt(double lbs); // construct from double pounds
  13. Stonewt(int stn, double lbs); // construct from stone, lbs
  14. Stonewt(); // default constructor
  15. ~Stonewt();
  16. void show_lbs() const; // show weight in pounds format
  17. void show_stn() const; // show weight in stone format
  18. // conversion functions
  19. operator int() const;
  20. operator double() const;
  21. };
  22. #endif