Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Task02_6
- {
- internal class Ring
- {
- private double innerrad;
- private double outerrad;
- public Ring(double ir, double or)
- {
- this.InnerRad = ir;
- this.OutterRad = or;
- }
- public double InnerRad
- {
- get
- {
- return this.innerrad;
- }
- set
- {
- if (value < this.outerrad)
- {
- this.innerrad = value;
- }
- }
- }
- public double OutterRad
- {
- get
- {
- return this.outerrad;
- }
- set
- {
- if (value > this.innerrad)
- {
- this.outerrad = value;
- }
- }
- }
- public double TotalCircumference()
- {
- return (2 * this.innerrad * Math.PI) + (2 * this.outerrad * Math.PI);
- }
- public double Area()
- {
- return (Math.PI * Math.Pow(this.outerrad, 2)) - (Math.PI * Math.Pow(this.innerrad, 2));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement