You are on page 1of 3

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace shopping_inventory_asi_
{
class Product
{
//the 'name'property
private string Nname;
public string Name
{
get
{
return Nname;
}
set
{
Nname=value;
}
}
public string model
{
get;
set;
}

//the string 'model'property


private string mModel;
public string mModel
{
get
{
return mModel;
}
set
{
mMode=value;
}
}
//condition enum
public enum eproductcondition
{
GOOD,
BAD,
UGLY
};

//the condition attribute


public eproductcondition condition=eproductcondition.GOOD;

//the 'Price'property
private decimal mPrice;
public decimal Price
{
get
{
return mPrice;
}
set
{
if(value>0)
{
mPrice=value;
}
else
{//if the value given is smaller than or equal to zero
mPrice=0;
}
}
}

//empty contsructor to set up default values


public Product()
{
Name="";
model="";
Price=0;
}

//constructor with parameters


public Product(string name,string model,eproductcondition
condition,decimal price)
{
Name=name;
model=model;
condition=condition;
price=price;
}

class product
{
#region MyRegion

#endregion
//the 'name'property
private string nName;
public string Make
{
get;
}
}
}
}
#region properties

//the 'name' property


private string nName;
public string nName;
#endregion

productTracking
class product
{
Properties
constructors;
methods

#region Methods

//Tostring method
Public;override string Tostring()
{
return name+"-"+model+"in"+"condition.price:R"+ Price;
}
}

#endregion

You might also like