Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace OOPGeometry2
- {
- class Triangle : Figure
- {
- private double x;
- private double h;
- public double X
- {
- get { return x; }
- set { x = value; }
- }
- public double H
- {
- get { return h; }
- set { h = value; }
- }
- public Triangle(double x, double h)
- : base("Triangle")
- {
- this.x = x;
- this.h = h;
- }
- public override double CalculateSurface()
- {
- return x * h / 2;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement