Class Progarm
{
static void Main (string[] argm)
{
Console.WriteLine ("Select to shape (enter the graphics serial number)");
Console.WriteLine ("1, Circle, 2, Rectangle, 3, triangle);
String str = Console.ReadLine ();
Switch (STR)
{
Case "1":
Console.WriteLine ("Please enter the radius of the Circle:");
int r = Int. Parse (Console.ReadLine ());
int YS = MG (R);
Console.WriteLine ("Round Area ={0}", YS);
Break
Case "2":
Console.WriteLine ("Please enter the length of the rectangle:");
int c = Int. Parse (Console.ReadLine ());
Console.WriteLine ("Please enter the width of the rectangle:");
int k = Int. Parse (Console.ReadLine ());
int JS = MG (c, k);
Console.WriteLine ("Area of Rectangle ={0}", JS);
Break
Case "3":
Console.WriteLine ("Please enter the base length of the triangle:");
int d = Int. Parse (Console.ReadLine ());
Console.WriteLine ("Please enter the height of the triangle:");
int g = Int. Parse (Console.ReadLine ());
int x = 2;
int SS = MG (d, G, X);
Comsole.writeline ("Area of Triangle ={0}", SS);
Break
}
}
static int MG (int r)
{
return Math.PI * R * r;
}
static int MG (int chang, int kuan)
{
Return Chang * KUAN;
}
static int MG (int di, int gao, int x)
{
return di * gao/x;
}
}
Calculate the area of a circle, rectangle, triangle