1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
public class localItem {
int itemQuantity,itemCostPrice,itemSellingPrice,itemSize;
int a,b,c,d;
localItem itemCode [] = new localItem[3];
localItem( int itemSize,int itemQuantity, int itemCostPrice,int itemSellingPrice) {
a=itemSize;
b= itemQuantity;
c=itemCostPrice;
d=itemSellingPrice;
}
public localItem addItem() {
localItem chose = new localItem(a,b,c,d);
return chose;
}
public void addQuantity() { itemQuantity++; }
public void sellItem () { itemQuantity--; }
public int currentValue()
{
return itemCostPrice;
}
public int currentProfit()
{
return itemSellingPrice-itemCostPrice;
}
public void printReport()
{
int i;
for (i=0;i<itemCode.length;i++)
System.out.println(itemCode[i]);
}
} |
Partager