Реферат: Введение в C#: классы
{
double Square();
}
class CRectangle: CShape, IShape
{
double width;
double height;
public CRectangle(double width, double height)
{
this.width = width;
this.height = height;
}
public double Square()
{
return (width * height);
}
}
class CCircle: CShape, IShape
{
double radius;
public CCircle(double radius)
{
this.radius = radius;
}
public double Square()
{
return (Math.PI * radius * radius);
}
}