/*Programmer:Miexie D. Tulid
*Title:Shirt class*/
public class Shirt
{
public int shirtID;
private double price;
private String color;
private String description;
private int quantity;
public Shirt(int newshirtID, double newprice, String newcolor, String newdescription, int newquantity)
{
shirtID=newshirtID;
price=newprice;
color=newcolor;
description=newdescription;
quantity=newquantity;
}
public int addStock( int stock)
{
quantity=quantity+stock;
return quantity;
}
public int removeStock( int stock)
{
quantity=quantity-stock;
return quantity;
}
public String displayInformation()
{
return String.format("ShirtID:"+shirtID+"nPrice:"+price+"\nColor:"+color+"\nDescription:"+description+"\nQuantity:"+quantity);
}
}
Monday, February 9, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment