Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Shapes
- {
- public class Rectangle : Shape
- {
- public Rectangle(double height, double width)
- {
- Height = height;
- Width = width;
- }
- public double Height { get; protected set; }
- public double Width { get; protected set; }
- public override double CalculateArea()
- {
- return Height * Width;
- }
- public override double CalculatePerimeter()
- {
- return 2 * Height + 2 * Width;
- }
- public override string Draw()
- {
- return base.Draw() + this.GetType().Name;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement