static private ulong fact(double a)
factorial = factorial * i;
static private double pertodec(double a)
static private double dectoper(double a)
static private ulong nPr(double n, double r)
ulong ans = fact(n) / fact(n - r);
static private ulong nCr(double a, double b)
ulong ans = fact(a - b) * fact(b);
ulong combi = fact(a) / ans;
static private double mean (double a, double b)
public static void Main()
{string restart = "anything";
Console.WriteLine(" Hello and Welcome to my probability calculator! Please choose an option from the menu ");
Console.WriteLine(" If you would like to calculate the factorial for a number press 1 ");
Console.WriteLine(" If you would like to convert from percentage to decimal, press 2");
Console.WriteLine(" If you would like to convert from decimal to percentage, press 3 ");
Console.WriteLine(" If you would like to calculate the permutation, press 4");
Console.WriteLine(" If you would like to calculate the combination, press 5");
Console.WriteLine(" If you would like to calculate the mean, press 6");
string input = Console.ReadLine();
Console.WriteLine(" What would you like to calculate the factorial of . ");
double num1 = ulong.Parse(Console.ReadLine());
Console.WriteLine(" The factorial of " + num1 + " is " + fact(num1));
Console.WriteLine("What percentage would you like to convert to decimal. ");
double num2 = double.Parse(Console.ReadLine());
Console.WriteLine(num2 + "% is equal to " + pertodec(num2));
Console.WriteLine("Enter the decimal number you would like to convert to percentage ");
double num3 = double.Parse(Console.ReadLine());
Console.WriteLine(num3 + " to percentage is " + dectoper(num3));
Console.WriteLine(" How many total objects do you have?");
double input1 = ulong.Parse(Console.ReadLine());
Console.WriteLine(" How many objects would you like to arrange? ");
double input2 = ulong.Parse(Console.ReadLine());
Console.WriteLine(input1 + "P" + input2 + "= " + nPr(input1, input2)) ;
Console.WriteLine(" How many total objects do you have ?");
double input1 = ulong.Parse(Console.ReadLine());
Console.WriteLine(" How many objects would you like to arranged if the order does not matter? ");
double input2 = ulong.Parse(Console.ReadLine());
Console.WriteLine( input1 + "C " + input2 + "=" + nCr(input1,input2));
Console.WriteLine(" enter the number of values of how many number you want to calculate the mean of ");
double numb = double.Parse( Console.ReadLine());
Console.WriteLine(" Please enter the vaules " ) ;
for (int i=1; i<= numb; i++)
{ double number = double.Parse(Console.ReadLine());
Console.WriteLine(" The mean is " + mean(sum,numb));
{ Console.WriteLine(" Please enter a correct number from 1-6 from the above options ");
Console.WriteLine("Press q to quit or anything else to continue the program.");
restart = Console.ReadLine();