usestok0.cpp 522 B

123456789101112131415161718192021
  1. // usestok0.cpp -- the client program
  2. // compile with stock.cpp
  3. #include <iostream>
  4. #include "stock00.h"
  5. int main()
  6. {
  7. Stock fluffy_the_cat;
  8. fluffy_the_cat.acquire("NanoSmart", 20, 12.50);
  9. fluffy_the_cat.show();
  10. fluffy_the_cat.buy(15, 18.125);
  11. fluffy_the_cat.show();
  12. fluffy_the_cat.sell(400, 20.00);
  13. fluffy_the_cat.show();
  14. fluffy_the_cat.buy(300000,40.125);
  15. fluffy_the_cat.show();
  16. fluffy_the_cat.sell(300000,0.125);
  17. fluffy_the_cat.show();
  18. // std::cin.get();
  19. return 0;
  20. }