diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..df13b4b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: cpp +os: linux +script: + - make diff --git a/Inventory.cpp b/Inventory.cpp index 57964b4..286fb27 100644 --- a/Inventory.cpp +++ b/Inventory.cpp @@ -5,6 +5,7 @@ using std::string; using std::ostream; +/*Constructor for an Inventory object*/ Inventory::Inventory(string name, float price, int count) { m_name = name; @@ -12,15 +13,25 @@ Inventory::Inventory(string name, float price, int count) m_in_stock = count; } +/*Checking if an item is an stock and making a sale + *ultimately decreasing stock. + */ + void Inventory::sell() { + if(m_in_stock == 0){ + std::cout<<"Sorry, that item is out of stock"<