public static string Verification_Method()
string userInput = Console.ReadLine();
if ( userInput.Length != 1 || Char.IsLetter(userInput[0]) == false )
Console.WriteLine("ERROR: Invalid Input -- You entered \"" + userInput + "\"" + Environment.NewLine);
public static void CalculatePi()
Random random = new Random();
int totalPoints = 1000000;
for (int i = 0; i < totalPoints; i++)
double x = random.NextDouble();
double y = random.NextDouble();
double distance = Math.Sqrt(x * x + y * y);
double estimatedPi = 4.0 * insideCircle / totalPoints;
Console.WriteLine("Approximation of π: " + estimatedPi);
public static void DrawBox()
bool widthVerification = false;
bool heightVerification = false;
while ( !widthVerification || !heightVerification )
Console.WriteLine("Enter Width: ");
string userWidthInput = Console.ReadLine();
if ( int.TryParse(userWidthInput, out Width) )
widthVerification = true;
Console.WriteLine("Enter Height: ");
string userHeightInput = Console.ReadLine();
if ( int.TryParse(userHeightInput, out Height) )
heightVerification = true;
Console.WriteLine($"{Width},{Height}");
for ( int i = 0; i < Height; i++ )
for ( int k = 0; k < Width; k++)
public static void Main()
Console.WriteLine(" --- Functions! ---");
string options = "Press A: Calculate Pi" + Environment.NewLine +
"Press B: Binomial Functions" + Environment.NewLine +
"Press C: Number Sort" + Environment.NewLine +
Console.WriteLine(options);
string userInput = string.Empty;
bool verification = false;
while ( verification == false )
userInput = Verification_Method();
switch (userInput.ToUpper())