Archived
Add files via upload
This commit is contained in:
1 parent
24a4f18380
commit
a522d70e6d
3 files changed
+117
No files matched your search
@@ -0,0 +1,37 @@
|
||||
public class Product
|
||||
{
|
||||
|
||||
private final String productCode;
|
||||
private int quantityInStock;
|
||||
|
||||
/** @return the code of this product
|
||||
*/
|
||||
public String getProductCode()
|
||||
{
|
||||
return productCode;
|
||||
}
|
||||
|
||||
/** @return the current quantity in stock of this product. This should never be negative.
|
||||
*/
|
||||
public int getQuant()
|
||||
{
|
||||
return quantityInStock;
|
||||
}
|
||||
|
||||
/** Sets the current quantity in stock of this product to the parameter value
|
||||
*/
|
||||
public void setQuant(int quantity)
|
||||
{
|
||||
quantityInStock = quantity;
|
||||
}
|
||||
|
||||
|
||||
/* CLASS MEMBERS FOR TESTING */
|
||||
/* DO NOT MODIFY ANY OF THE CONSTRUCTORS OR METHODS BELOW */
|
||||
public Product(String det)
|
||||
{
|
||||
productCode = det.split("/")[0];
|
||||
quantityInStock = Integer.parseInt(det.split("/")[1]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user