mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
37 lines
501 B
C#
37 lines
501 B
C#
namespace Packt.Shared;
|
|
|
|
public abstract class Shape
|
|
{
|
|
// fields
|
|
protected double height;
|
|
protected double width;
|
|
|
|
// properties
|
|
public virtual double Height
|
|
{
|
|
get
|
|
{
|
|
return height;
|
|
}
|
|
set
|
|
{
|
|
height = value;
|
|
}
|
|
}
|
|
|
|
public virtual double Width
|
|
{
|
|
get
|
|
{
|
|
return width;
|
|
}
|
|
set
|
|
{
|
|
width = value;
|
|
}
|
|
}
|
|
|
|
// Area must be implemented by derived classes
|
|
// as a read-only property
|
|
public abstract double Area { get; }
|
|
} |