Skip to content
Permalink
a9c74464c6
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
59 lines (56 sloc) 1.01 KB
#pragma once
class Inventory
{
private:
int itemID;
int amount;
double cost;
double totalCost;
public:
Inventory() // declare the Inventory object using the constructor
{
itemID = 0;
amount = 0;
cost = 0;
totalCost = 0;
}
Inventory(int newItemID, int newamount, double newCost)
{
itemID = newItemID;
amount = newamount;
cost = newCost;
setTotalCost(amount, cost);
}
void setItemID(int)
{
itemID = itemID;
}
void setamount(int)
{
amount = amount;
}
void setCost(double)
{
cost = cost;
}
void setTotalCost(int, double)
{
totalCost = amount * cost;
}
int getItemID()
{
return itemID;
}
int getQuantity()
{
return amount;
}
double getCost()
{
return cost;
}
double getTotalCost()
{
return totalCost;
}
};