126k views
0 votes
Write a class declaration named Circle with a private member variable named radius. Write set and get functions to access the radius variable, and a function named getArea that returns the area of the circle.the area calcilated as?

User Gilsho
by
5.1k points

1 Answer

5 votes

Answer:

Step-by-step explanation:

The following code is in C# Language

public class Circle

{

private float radius;

public float Radius

{

get { return radius; }

set { radius = value; }

}

public void GetArea()

{

Console.WriteLine("The area of the circle is ", Math.PI* Radius *Radius);

}

User Thomas Mutzl
by
4.8k points