internal class Program { private static void Main(string[] args) { //VARIABLES const double Pi = 3.142; double ConeVolume; double Radius; double Height; //User Input for Values Radius and Height //Radius Console.WriteLine("Please enter the radius of the cone"); Radius = Convert.ToDouble(Console.ReadLine()); //Range Check to ensure that a value is entered that is more than 0 do { if (Radius < 1) { Console.WriteLine("Error! Invalid value Entered. Value must be Positive!"); Console.WriteLine(" "); Console.WriteLine("Please enter the radius of the cone"); Radius = Convert.ToDouble(Console.ReadLine()); } } while (Radius < 1); Console.WriteLine(" "); //Height Console.WriteLine("Please enter the height of the cone"); Height = Convert.ToDouble(Console.ReadLine()); //Range Check to ensure that a value is entered that is more than 0 do { if (Height < 1) { Console.WriteLine("Error! Invalid value Entered. Value must be Positive!"); Console.WriteLine(" "); Console.WriteLine("Please enter the height of the cone"); Height = Convert.ToDouble(Console.ReadLine()); } } while (Height < 1); //Calculates the volume of the cone ConeVolume = Pi * (Radius * Radius) * (Height / 3); //Outputs the volume of the cone to 2 decimal places Console.WriteLine("The volume of the cone is " + String.Format("{0:0.00}", ConeVolume)); Console.WriteLine("Press Enter to exit the program"); } }