using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//Namespace declaration
namespace figures
{
//Rectangle Class declaration
class rectangle
{
// member variables
double length;
double breadth;
double height;
//member function to accept data values
public void Acceptdata()
{
length = 3.5;
breadth = 2.5;
height = 1.5;
}
//member function to get area and volume of rectangle
public double GetArea_Rect()
{
return length * breadth;
}
public double GetVolume_Rect()
{
return length * breadth * height;
}
//member function to display dimensions of rectangle
public void Dimension_Rect()
{
Console.WriteLine("Dimensions of rectangle");
Console.WriteLine("Length: {0}", length);
Console.WriteLine("Breadth: {0}", breadth);
Console.WriteLine("Height: {0}\n", height);
}
//member function to display area of rectangle
public void Display_Area()
{
Console.WriteLine("Area Of Rectangle: {0}", GetArea_Rect());
}
//member function to display volume of rectangle
public void Display_Volume()
{
Console.WriteLine("Volume Of Rectangle: {0}\n", GetVolume_Rect());
}
}
//Circle Class declaration
class circle
{
// member variables
double radius;
//member function to accept data values
public void Acceptdata()
{
radius = 5.5;
}
//member function to get area and circumference of circle
public double GetArea_Circle()
{
return 3.14 * radius * radius;
}
public double GetCircumference()
{
return 2 * 3.14 * radius;
}
//member function to display dimensions of Circle
public void Dimension_Circle()
{
Console.WriteLine("Dimensions of Circle");
Console.WriteLine("Radius: {0}\n", radius);
}
//member function to display area of circle
public void Display_Area()
{
Console.WriteLine("Area Of Circumference: {0}", GetArea_Circle());
}
//member function to display circumference of circle
public void Display_Circumference()
{
Console.WriteLine("Circumference Of Circle: {0}\n", GetCircumference());
}
}
//Main class declaration
class ExecuteFigures
{
//Main method
static void Main(string[] args)
{
Console.WriteLine("**Geometric Figures**\n");
// Creating instance/object of claas rectangle
rectangle r = new rectangle();
//Calling member functions using instance of class rectangle
r.Acceptdata();
r.Dimension_Rect();
r.Display_Area();
r.Display_Volume();
// Creating instance/object of claas circle
circle c = new circle();
//Calling member functions using instance of class circle
c.Acceptdata();
c.Dimension_Circle();
c.Display_Area();
c.Display_Circumference();
}
}
}