inventory(int n, int q, double c){
n = getItemnumber();
q = getQuantity();
c = getCost();
cout << n << ": " << getTotalcost(q, c) << "\n\n";
}
This constructor never initializes your itemNumber, quantity, or cost members. As a result, your getxxx() functions are all returning uninitialized variables which are filled with garbage.
It also doesn't make sense to assign local variables 'n', 'q', and 'c'. By doing that you are effectively throwing away what is passed to the constructor.
You probably just have your assignments backwards:
1 2 3 4 5
inventory(int n, int q, double c)
{
itemNumber = n; // assign itemNumber... not n
quantity = q; // ditto
cost = c; // ditto