logo

Crowdly

Browser

Add to Chrome

Проаналізуйте наведений код. class Circle { рrotected double r = 5; pub...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Проаналізуйте наведений код.

class Circle

{ рrotected double r = 5;

public Circle (double r) {this.r = r; }

public virtual int Figure()

{return (int) (3.14 * r * r); }

}

class Cylinder: Circle

{ double h = 10;

public Cylinder (double r, double h): base (r)

{this.h = h; }

public override int Figure() {return (int) (3.14 * r * r * h); }

}

class Cone: Circle

{ double h = 10;

public Cone (double r, double h): base (r)

{this.h = h; }

public override int Figure()

{return (int) (3.14 * r * r * h / 3.0); }

}

class Program

{ static void Param (Circle fig)

{ System.Console.Write (fig.Figure() + "");

}

static void Main ()

{ рaram (new Circle(1) ); }

}

Вкажіть результат виведення на консоль після спроби запустити програму на компіляцію і виконання:

C# oop_class

100%
0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.chnu.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome