static private ulong fact(ulong a)
factorial = factorial * i;
static private double DectoPer(double a)
static private double PertoDec(double a)
static private ulong nPR(ulong a, ulong b)
ulong abfact = fact(a - b);
static private ulong nCR(ulong x, ulong y)
ulong xyfact = fact(sub);
return xfact / xyfact * yfact;
static private double mean(double a, double b, double c, double d, double e)
double avg = (a + b + c + d + e) / 5;
public static void Main()
while (repeat != "q" && repeat != "Q")
Console.WriteLine("Enter 1 for factorial calculator, enter 2 to convert from decimal to percent, enter 3 to convert from percent to decimal, enter 4 to calculate the Permutation, enter 5 to calculate the combination, enter 6 for mean.");
string choice = Console.ReadLine();
Console.WriteLine("What number would you like to calculate the factorial of?");
ulong fac = ulong.Parse(Console.ReadLine());
Console.WriteLine("The factorial of " + fac + " is " + fa + ".");
Console.WriteLine("Please enter a decimal");
double dec = double.Parse(Console.ReadLine());
double per = DectoPer(dec);
Console.WriteLine("The decimal " + dec + " would convert to a percentage of " + per + "%.");
Console.WriteLine("Please enter a percentage");
double pe = double.Parse(Console.ReadLine());
double de = PertoDec(pe);
Console.WriteLine("The percentage " + pe + "% would convert to a decimal of " + de + ".");
Console.WriteLine("Please enter the total number of items.");
ulong it = ulong.Parse(Console.ReadLine());
Console.WriteLine("Please enter the number you would like them to be arranged");
ulong arr = ulong.Parse(Console.ReadLine());
ulong perm = nPR(it, arr);
Console.WriteLine("The Permutation of a total number of items " + it + " and the number of items arrangered " + arr + " is " + perm + ".");
Console.WriteLine("Pleae enter How many items do you have?");
ulong i = ulong.Parse(Console.ReadLine());
Console.WriteLine("Pleae enter How many items you want to choose?");
ulong choose = ulong.Parse(Console.ReadLine());
ulong comp = nCR(i, choose);
Console.WriteLine("The Combination of a total number of items " + i + " and the number of items chosen " + choose + " is " + comp + ".");
Console.WriteLine("Please enter the first number");
double num1 = double.Parse(Console.ReadLine());
Console.WriteLine("Please enter the second number");
double num2 = double.Parse(Console.ReadLine());
Console.WriteLine("Please enter the third number");
double num3 = double.Parse(Console.ReadLine());
Console.WriteLine("Please enter the fourth number");
double num4 = double.Parse(Console.ReadLine());
Console.WriteLine("Please enter the fifth number");
double num5 = double.Parse(Console.ReadLine());
double m = mean(num1, num2, num3, num4, num5);
Console.WriteLine("The mean of the numbers " + num1 + ", " + num2 + ", " + num3 + ", " + num4 + ", " + num5 + " is " + m);
Console.WriteLine("Please enter a vaild number. Press enter to continue");
Console.WriteLine("Please enter q to quit or any other key to continue.");
repeat = Console.ReadLine();