Well ... take a pad and pencil, start thinking about the data and Types
You have an Item
So, you have an Item Name - String ?, Item Price - Double, Quantity Left - Integer .. (for example)
You'll need to think about wether these should be public, private (to your Item Class for instance), and wether you need to use get/set for example
Then think about what operations you'd have - 'Items' are sold arnt they - so maybe you'd have a method for 'selling' an item - that would take a quantity of how many units are being sold and throw some sort of error if the requested quantity is more than the quantity left
You already have a clue to one method you'll need - ToString()
So, I'd start with maybe
public Class Item
{
public String itemName {get; set;}
public Decimal itemPrice {get; set;}
public Int itemQuantityLeft {get; set;}
public override String ToString()
{
String readableItem =
String.Format(
"Name {0} Price {1} Quantity Left {2}",
itemName, itemPrice, itemQuantityLeft);
return readableItem;
}
}
but that's a 30sec starter - you need to implement a constructor, the method for Selling an Item, .... seems you have a lot of reading to do