static void Main(string[] args) { Console.WriteLine(Algebra.Addition(10.1234, 5.4321)); Console.WriteLine(Algebra.Subtraction(10.1234, 5.4321)); Console.WriteLine(Algebra.Multiplication(10.1234, 5.4321)); Console.WriteLine(Algebra.Division(10.1234, 5.4321)); Console.WriteLine(Algebra.Abs(-1)); Console.WriteLine(Algebra.IsDivisible(0, -1)); Console.WriteLine(Algebra.IsPrime(100)); Algebra.FactorList(10); Console.WriteLine(Algebra.Factorial(0)); Console.WriteLine(Algebra.Summation(-20)); Console.WriteLine("Welcome to my mathematical concepts project."); Console.WriteLine("This is a very simple project designed to be used as a calculator of sorts, \nin order to give me more understanding of various concepts in math when applied in programming."); Console.WriteLine("I have included a loop to allow any potential User to test this project out as they would like"); Console.WriteLine("To exit the loop, when at the main screen, type QUIT, and the program will end."); }
//TODO Add a check, so the user cannot input anything equal to or less than 0, as that is impossible with this theorem public double PythagoreanTheorem(double x, double y) //Represents the Pythagorean Theorem (A^2 + B^2 = C^2) { double z = Algebra.Addition(Math.Pow(x, 2), Math.Pow(y, 2)); return(Math.Sqrt(z)); //returns the square root of z, rather than z^2 that the function would otherwise produce }