Product: Using Using Using Using Namespace Class
Product: Using Using Using Using Namespace Class
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 '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;
}
}
}
class product
{
#region MyRegion
#endregion
//the 'name'property
private string nName;
public string Make
{
get;
}
}
}
}
#region properties
productTracking
class product
{
Properties
constructors;
methods
#region Methods
//Tostring method
Public;override string Tostring()
{
return name+"-"+model+"in"+"condition.price:R"+ Price;
}
}
#endregion