Guest User

Untitled

a guest
Jul 13th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include "product.hpp"
  4. using std::string;
  5.  
  6.  
  7. // Constructor
  8. Product::Product(std::string id, std::string t, std::string d, double p, int qa)
  9. {
  10.     idCode = id;
  11.     title = t;
  12.     description = d;
  13.     price = p;
  14.     quantityAvailable = qa;
  15. }
  16.  
  17. //Return Product title
  18. string Product::getTitle()
  19. {
  20.     return title;
  21. }
  22.  
  23. // Returns ID
  24. string Product::getIdCode()
  25. {
  26.     return idCode;
  27. }
  28.  
  29. // Return Description
  30. string Product::getDescription()
  31. {
  32.     return description;
  33. }
  34.  
  35. //Return Price
  36. double Product::getPrice()
  37. {
  38.     return price;
  39. }
  40.  
  41. // Return Quantity available
  42. int Product::getQuantityAvailable()
  43. {
  44.     return quantityAvailable;
  45. }
  46.  
  47. // Decrease Qty
  48. void Product::decreaseQuantity()
  49. {
  50.     quantityAvailable--;
  51. }
Add Comment
Please, Sign In to add comment