public static void Main()
string restart = "hello world";
Console.WriteLine("Hello and Welcome to My Probability Calculator! Please Choose an option from the menu!");
Console.WriteLine("If you would like to calculate Factorial, please press 1.");
Console.WriteLine("If you would like to calculate Decimal to Percent, please press 2.");
Console.WriteLine("If you would like to calculate Percent to Decimal,, please press 3.");
Console.WriteLine("If you would like to calculate the Mean of a list of numbers, please press 4.");
Console.WriteLine("If you would like to calculate the Permutation, please press 5");
Console.WriteLine("If you would like to calculate the Combination of a list of numbers, please press 6.");
int choice = int.Parse(Console.ReadLine());
Console.WriteLine("Please enter a postive number to calculate the factorial of.");
ulong input = ulong.Parse(Console.ReadLine());
ulong output = fact(input);
Console.WriteLine(output);
Console.WriteLine("The factorial of " +input+ "! =" +output);
Console.WriteLine("We're sorry, the number exceeds the holding of the data type, Please choose a smaller number!");
Console.WriteLine("Press q to quit or any other key to continue.");
restart = Console.ReadLine();
Console.WriteLine("If you would like to convert a decimal to a percent, please enter a number");
Console.WriteLine("What decimal would you like to convert to percent?");
double ans = double.Parse(Console.ReadLine());
Console.WriteLine(ans + " = " + DectoPer(ans));
Console.WriteLine("Press q to quit or any other key to continue.");
restart = Console.ReadLine();
Console.WriteLine("If you would like to convert a percent to decimal, please enter a number");
double ans = double.Parse(Console.ReadLine());
Console.WriteLine(ans + " = " + PertoDec(ans));
Console.WriteLine("Press q to quit or any other key to continue.");
restart = Console.ReadLine();
Console.WriteLine("Please enter three numbers to calculate the mean of");
double mean1 = double.Parse(Console.ReadLine());
double mean2 = double.Parse(Console.ReadLine());
double mean3 = double.Parse(Console.ReadLine());
Console.WriteLine("okay, the mean of your three numbers is " +mean(mean1, mean2, mean3));
Console.WriteLine("Press q to quit or any other key to continue.");
restart = Console.ReadLine();
Console.WriteLine("Please enter the amount of numbers you want in your set.");
ulong n = ulong.Parse(Console.ReadLine());
Console.WriteLine("Please now enter the amount of objects you want to choose from this set.");
ulong o = ulong.Parse(Console.ReadLine());
Console.WriteLine("From the numbers chosen, the perumuations of " +o+ " from " +n+ " is " +Perm(n, o));
Console.WriteLine("We're sorry, the number exceeds the holding of the data type, Please choose a smaller number!");
Console.WriteLine("Press q to quit or any other key to continue.");
restart = Console.ReadLine();
Console.WriteLine("Please enter the amount of items you have.");
ulong n1 = ulong.Parse(Console.ReadLine());
Console.WriteLine("How many ways would like to have this set up?");
ulong w = ulong.Parse(Console.ReadLine());
Console.WriteLine(n1 + "C" + w + " = " + nCr(n1, w));
Console.WriteLine("We're sorry, the number exceeds the holding of the data type, Please choose a smaller number!");
Console.WriteLine("Press q to quit or any other key to continue.");
restart = Console.ReadLine();
static private ulong fact(ulong a)
factorial = factorial * i;
static private double DectoPer(double a)
static private double PertoDec(double a)
static private double mean(double a, double b, double c)
double addition = a + b + c;
double Mean = addition/3;
static private ulong Perm(ulong n, ulong o)
ulong Order = fact(order);
ulong permutation = N / order;
static private ulong nCr(ulong n, ulong o)
ulong nofact = fact(n - o);
return nfact/((nofact) * (ofact));