// ENGR 131, Monday 3:30 Recitation (Amanda Rohn) // HW #12 - Inventory Keeper // Solution // File: inventory.h // Contains declaration of the class Inventory, which holds inventory data for a product #include "inventory.h" #include #include using std::string; Inventory::Inventory() { idnum = unitprice = instock = 0; prodname = ""; } Inventory::Inventory(int id, string name, double price, int stocked) { idnum = id; prodname = name; unitprice = price; instock = stocked; } int Inventory::ProdNum() { return idnum; } string Inventory::Name() { return prodname; } double Inventory::Price() { return unitprice; } int Inventory::NumStocked() { return instock; } void Inventory::SetStocked(int numstocked) { assert(numstocked >= 0); instock = numstocked; }