logo

Crowdly

Browser

Add to Chrome

Проаналізуйте наведений код. class Rectangle { рublic int x = 10, y = 20; ...

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

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

class Rectangle

{ рublic int x = 10, y = 20;

public Rectangle (int x, int y)

{this.x = x; this.y = y; }

public virtual int Zoom

{

get {return x * y; }

set {x + = value; y + = value; }}

}

class Рarallelepiped: Rectangle

{ рublic int z;

public Рarallelepiped (int x, int y, int z): base (x, y)

{this.z = z; }

public override int Zoom

{

get {return x * y * z; }

set {x + = value; y + = value; z + = value; }}

}

class Program

{ static void Main ()

{ Rectangle parall = new Рarallelepiped (6, 8, 10);

parall.Zoom = -5; System.Console.Write (parall.Zoom); }

}

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

C# oop_class

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