Question: DESCRIP TION Write a class named InventoryItem that can hold information for an item in a retail store's inventory. The class should have the following


DESCRIP TION Write a class named InventoryItem that can hold information for an item in a retail store's inventory. The class should have the following private data members: number: An integer that holds the item's number. name: A string that describes the item. quantity: An integer that holds the quantity of the item on hand. cost: A double that holds the wholesale per-unit cost of the item. . The class should have the following public members: constructor 1The default constructor which sets all numeric data members to 0 and name to empty string. Use an initializer list for this. constructor #2 : Accepts an item's number and name as arguments and sets the remaining quantity, and cost to O. Use an initializer list for this. constructor #3 : Accepts an item's number, name, quantity, and cost as arguments. Use an initializer list for this. destructor: An empty destructor. . . accessors: Write a getter function (accessor) for each data member. Use const with these functions and, if the return type is non-primitive, return a const reference to the data member. mutators: Write a setter function (mutator) for each data member. Accepts a single argument. getTotalCost: A const function that computes and returns the total cost of all the units on hand. The total cost is calculated by multiplying quantity by cost
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
