Question

Design and test an inventory class that can hold information and calculate data for items in a…

Design and test an inventory class that can hold information and calculate data for items in a retail store's inventory. Here is a list of the files you will beworking with while designing, implementing and testing the Inventory class.

This program needs to include these three files:
inventory.h

inventory.cpp

client.cpp

(1) Design and build the Inventory class specification file and implementation file

(2) Demonstrate the Inventory class implementation using the following client code to serve as a driver program to test your Inventory class.

Here is the client program.

// Project#3b - client code to serve as a driver program for testing the Inventory class implementation//// Additional files needed to compile this multifile programming project:// Inventory.h-- contains Inventory class specification and inline functions// Inventory.cpp -- contains Inventory class function definitions// client.cpp -- this file used to create new inventory class objects and to test a few operation#include <iostream>#include <iomanip>#include "Inventory.h"using namespace std;int main(){cout << fixed << showpoint << setprecision(2);cout<<"This is a driver program to test the Inventory class implementation.n";cout<<"Three Inventory class objects are defined here and used to test access n";cout<<"to the object's data members and procedures through the interface providedn";cout<<"by the Inventory class member implementation.nn";// Demonstrate the default constructor and the "get" functionsInventory stockItem1;cout << "(1)Demonstrating the default constructor.n";cout << ""get" functons used to display default values in the stockItem1 object...n";cout<<"******************************************************n";cout << "Item number: " << stockItem1.getItemID() << endl;cout << "Quantity: " << stockItem1.getItemQuantity() << endl;cout << "Cost: $" << stockItem1.getItemCost() << endl;// Now demonstrate the overloaded constructor and the "get" functionsInventory stockItem2(124, 12, 84.95);cout << "n(2)Demonstrating the overloaded constructor.n";cout << ""get" functons used to display values in the stockItem2 object...n";cout<<"******************************************************n";cout << "Item number: " << stockItem2.getItemID() << endl;cout << "Quantity: " << stockItem2.getItemQuantity() << endl;cout << "Cost: $" << stockItem2.getItemCost() << endl;// Now demonstrate the member "set" functions used to update or change an objects valuesstockItem2.setItemID(243);stockItem2.setItemQuantity(50);stockItem2.setItemCost(9.50);cout << "n(3)Demonstrating the "set" functions used to update the stockItem2 object.n";cout << ""get" functons used to display values in this object ...n";cout<<"******************************************************n";cout << "Item number: " << stockItem2.getItemID() << endl;cout << "Quantity: " << stockItem2.getItemQuantity() << endl;cout << "Cost: $" << stockItem2.getItemCost() << endl;cout << "Total Cost in inventory : $" << stockItem2.getTotalCost() << endl;// Now demonstrate the getItemDetails and showItemDetails functionInventory stockItem3;cout << "n(4)Demonstrating the "getItemDetails" function used to input item details n";cout <<"into a new stockItem3 object ...n";cout<<"******************************************************n";stockItem3.getItemDetails();cout << "n(5)Demonstrating the "showItemDetails" function used to display values. n";cout << "in this object ...n";cout<<"******************************************************n";stockItem3.showItemDetails();cout<<"*******************************************************nn";//system("PAUSE");return 0;}



Here is the program output


This is a driver program to test the Inventory class implementation. Three Inventory class objects are defined here and used to test access to the object's datamembers and procedures through the interface provided by the Inventory class member implementation.

(1)Demonstrating the default constructor. "get" functons used to display default values in the stockItem1 object…****************************************************** Item number: 0 Quantity : 0 Cost : $0.00

(2)Demonstrating the overloaded constructor. "get" functons used to display values in the stockItem2 object…****************************************************** Item number: 124 Quantity : 12 Cost : $84.95

(3)Demonstrating the "set" functions used to update the stockItem2 object. "get" functons used to display values in this object …****************************************************** Item number: 243 Quantity : 50 Cost : $9.50 Total Cost in inventory : $475.00

(4)Demonstrating the "getItemDetails" function used to input item details into a new stockItem3 object … ******************************************************To add an item to the inventory, please input the following details: Item number: 111 Quantity : 10 Cost : $5.99

(5)Demonstrating the "showItemDetails" function used to display values. in this object … ****************************************************** Item number: 111Quantity : 10 Cost : $5.99 Sale Price : $7.79 Total Cost in inventory : $59.90 Item quantity is at safety stock level*******************************************************


Solutions

Expert Solution
No answers


Submit Your Answer