{ static decimal pi = 3.14159M;
static private decimal cone(decimal r, decimal h)
return (1M/3M)*pi*r*r*h;}
static private decimal ConSuf(decimal r, decimal h)
return (pi*r*h)+(pi*r*r);}
static private decimal cyl(decimal r,decimal h)
static private decimal CylSuf(decimal r,decimal h)
{return (2*pi*r*r)+(2*pi*(r/2));}
static private decimal sph(decimal r)
{return (4M/3M)*pi*r*r*r;}
static private decimal SphSuf(decimal r)
public static void Main()
Console.WriteLine("Welcome to the program to claulate the volume and Surface Area");
Console.WriteLine("Press 1 to calculate the volume and Surface Area of Cone");
Console.WriteLine("Press 2 to calculate the volume and Surface Area of cylinder");
Console.WriteLine("Press 3 to calculate the volume and Surface Area of sphere.");
string choice = Console.ReadLine();
{Console.WriteLine("Please Enter the radius of your Cone.");
decimal radius = decimal.Parse(Console.ReadLine());
Console.WriteLine("Please Enter the height of your Cone");
decimal height = decimal.Parse(Console.ReadLine());
Console.WriteLine("The volume of your cone is: " + cone(radius,height).ToString("##.##"));
Console.WriteLine("The Surface Area of your cone is: " + ConSuf(radius,height).ToString("##.##"));
Console.WriteLine("Would you Like to Run the Program Again? Press 1 for Yes or Press 2 for No");
int opt =int.Parse( Console.ReadLine());
Console.WriteLine("Thank You For Using Our Program");
{Console.WriteLine("Please Enter the radius of your Cylinder.");
decimal radius = decimal.Parse(Console.ReadLine());
Console.WriteLine("Please Enter the height of your Cylinder");
decimal height = decimal.Parse(Console.ReadLine());
Console.WriteLine("The volume of your Cylinder is: " + cyl(radius,height).ToString("##.##"));
Console.WriteLine("The Surface Area of your Cylinder is: " + CylSuf(radius,height).ToString("##.##"));
Console.WriteLine("Would you Like to Run the Program Again? Press 1 for Yes or Press 2 for No");
int opt =int.Parse( Console.ReadLine());
Console.WriteLine("Thank You For Using Our Program");
{Console.WriteLine("Please Enter the radius of your Sphere.");
decimal radius = decimal.Parse(Console.ReadLine());
Console.WriteLine("The volume of your sphere is: " + sph(radius).ToString("##.##"));
Console.WriteLine("The Surface Area of your sphere is: " + SphSuf(radius).ToString("##.##"));
Console.WriteLine("Would you Like to Run the Program Again? Press 1 for Yes or Press 2 for No");
int opt =int.Parse( Console.ReadLine());
Console.WriteLine("Thank You For Using Our Program");