stock00.h 535 B

123456789101112131415161718192021222324
  1. // stock00.h -- Stock class interface
  2. // version 00
  3. #ifndef STOCK00_H_
  4. #define STOCK00_H_
  5. #include <string>
  6. class Stock // class declaration
  7. {
  8. private:
  9. std::string company;
  10. long shares;
  11. double share_val;
  12. double total_val;
  13. void set_tot() { total_val = shares * share_val; }
  14. public:
  15. void acquire(const std::string & co, long n, double pr);
  16. void buy(long num, double price);
  17. void sell(long num, double price);
  18. void update(double price);
  19. void show();
  20. }; // note semicolon at the end
  21. #endif