Define a class named Inventory. The class inventory should be written in a header file name Inventory.hpp. The class consists of following variables and functions--
Variables:
- itemNumber-an integer variable that stores the item's number
- quantity-an integer variable that holds the quantity of the item onhand
- cost--a double that holds the wholesale per unit cost of the item
- totalCost--a double thta holds the total inventory cost of the item (quantity*cost)
Functions:
- a default constructor that sets all the member variables to zero
- setItemNumber--accepts an integer argument that is copied to item-Number membe rvariable
- setQuantity-accepts an integer argument that is copied to quantity member variable
- setCost--accepts a double argument this is copied to cost member variable
- setTotalCost-calculates the total inventory cost for the item (quantity*cost) and stores the result in totalCost
- getItemNumber-returns the value in variable itemNumber
- getQuantity--returns the value in variable quantity
- getCost--returns the value in variable cost
- getTotalCost--returns the value in variable totalCost.
All the class variables should be private and the class functions public. The class functions should be implemented in a file Inventory.cpp which should be linked with the inventory.hpp file.
After being done with the class declaration, create a file named Inventory-Main.cpp where you need to write your main function. You need to link both Inventory.cpp and Inventory.hpp to this file. In the main function, create an object of Type Inventory. Prompt the user to enter a value for the variables itemNumber, quantity, and cost. Set the variables and calculate the total cost. Display the values of all the variables for the object using the get functions in the following format:
"The item number 1 has 12 quantity each having a cost of 1.5 unit with the total cost being 18 units"