DO THIS IN C#.Design and implement a program (name it ComputeAreas) that defines four methods as follows: Method squareArea (double side) returns the area of a square. Method rectangleArea (double width, double length) returns the area of a rectangle. Method circleArea (double radius) returns the area of a circle. Method triangleArea (double base, double height) returns the area of a triangle. In the main method, test all methods with different input value read from the user. Document your code and properly label the input prompts and the outputs as shown below. Sample run: Square side: 5.1 Square area: 26.01 Rectangle width: 4.0 Rectangle length: 5.5 Rectangle area: 22.0 Circle radius: 2.5 Circle area: 19.625 Triangle base: 6.4 Triangle height: 3.6 Triangle area: 11.52
# the code in C# for computing areas
using System;
class ComputeAreas //Calculate the Average marks and percentage for
students
{
static public void Main(string[] args)
{
double length, width, radius, side, Base,hieght,area;
//create an object of class ComputeAreas
ComputeAreas obj = new ComputeAreas();
Console.WriteLine("Enter the side of a square");
side = float.Parse(Console.ReadLine());
area=obj.squareArea(side);
Console.WriteLine("Area of Square is :{0}", area);
//Rectangle Area
Console.WriteLine("Enter the Length for Rectangle");
length = float.Parse(Console.ReadLine());
Console.WriteLine("Enter the breadth for Rectangle");
width = float.Parse(Console.ReadLine());
area=obj.rectangleArea(width,length);
Console.WriteLine("Area of rectangle is :{0}", area);
Console.WriteLine("Enter the Radius of the Circle");
radius = float.Parse(Console.ReadLine());
area=obj.circleArea(radius);
Console.WriteLine("Area of Circle is :{0}", area);
Console.WriteLine("Enter the Base of Triangle ");
Base = float.Parse(Console.ReadLine());
Console.WriteLine("Enter the Height of Triangle ");
hieght = float.Parse(Console.ReadLine());
area=obj.triangleArea(Base,hieght);
Console.WriteLine("Area of Triangle is :{0}", area);
}
public double squareArea (double side)
{
double area;
area=side*side;
return area;
}
public double rectangleArea (double width, double length)
{
double area;
area=length*width;
return area;
}
public double circleArea (double radius)
{
double area;
area=3.14*radius*radius;
return area;
}
public double triangleArea (double Base, double hieght)
{
double area;
area=Base*hieght/2;
return area;
}
}

DO THIS IN C#.Design and implement a program (name it ComputeAreas) that defines four methods as...