{static decimal pi = 3.14159M;
static private decimal sph(decimal a)
return 4 / 3M * pi * s3;}
static private decimal cyl(decimal b, decimal c)
static private decimal cone(decimal d, decimal e)
return 1 / 3M * pi * t2 * e;}
public static void Main()
Console.WriteLine("Would you like to calculate the volume of a Sphere (S for sphere), Cylinder (CY for Cylinder) or a Cone (CO for Cone)?");
string choice = Console.ReadLine();
if (choice == "S" && choice == "s")
Console.WriteLine("Enter a Postive number");
string inp1 = Console.ReadLine();
if (decimal.TryParse(inp1, out v1))
Console.WriteLine("You didn't enter a number higher then 0");
Console.WriteLine("Press enter to input another number");
decimal sphS = (sph(v1));
Console.WriteLine("The volume of the sphere is " + sphS.ToString("##.##"));
if (choice == "CY" && choice == "cy" && choice == "Cy" && choice == "cY")
Console.WriteLine("Enter 2 postive numbers");
string inp2 = Console.ReadLine();
string inp3 = Console.ReadLine();
if (decimal.TryParse(inp2, out v2))
if (decimal.TryParse(inp3, out v3))
Console.WriteLine("You didn't enter a number higher then 0");
Console.WriteLine("Press enter to input another number");
else if (v2 > 0 || v3 > 0)
decimal cylS = (cyl(v2, v3));
Console.WriteLine("The volume of the Cylinder is " + cylS.ToString("##.##"));
if (choice == "CO" && choice == "co" && choice == "cO" && choice == "Co")
Console.WriteLine("Please Enter 2 Postive Values");
string inp4 = Console.ReadLine();
string inp5 = Console.ReadLine();
if (decimal.TryParse(inp4, out v4))
if (decimal.TryParse(inp5, out v5))
Console.WriteLine("You didn't enter a number higher then 0");
Console.WriteLine("Press enter to input another number");
else if (v4 > 0 || v5 > 0)
decimal coneS = (cone(v4, v5));
Console.WriteLine("The volume of the cone is " + coneS.ToString("##.##"));
Console.WriteLine("Would you like to run the program again? y/n");
string choice1 = Console.ReadLine();
if (choice1 == "y" || choice1 == "Y")