From 85d61968a15e4a58536598422e453a422ba88960 Mon Sep 17 00:00:00 2001 From: Destiny Rogers Date: Wed, 12 Feb 2020 11:16:47 -0800 Subject: [PATCH 1/2] Fix negative stock bug, add documentation and instructions included in README --- Inventory.cpp | 13 ++++++++++++- Inventory.h | 10 +++++++++- README.md | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 README.md 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"< Date: Wed, 12 Feb 2020 11:20:12 -0800 Subject: [PATCH 2/2] add travis script --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .travis.yml 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