public Quantity ( string product ) : int | ||
product | string | The name of the product to check the quantity of. |
Результат | int |
public int Quantity(string product)
{
// If the inventory contains the product: return it's quantity
if (Contains(product))
{
return items[product].Quantity;
}
// Otherwise quantity is 0
else
{
return 0;
}
}