Exemplo n.º 1
0
        public void GetCoffOfQuadraticEq()
        {
            Console.WriteLine("You chose the quadratic type of equation and you should enter three coefficients, a, d and c (integer or real numbers):\n" +
                              "ax^2+bx+c=0");
            Console.WriteLine("Enter the first coefficient: ");
            double a = CheckTheDouble();

            Console.WriteLine("Enter the second coefficient: ");
            double b = CheckTheDouble();

            Console.WriteLine("Enter the third coefficient: ");
            double c = CheckTheDouble();

            Solving trySolve = new Solving(a, b, c);
            String  solving  = trySolve.FindRoots();
            Logg    log      = new Logg();

            String line = "The user chose the quadratic type of equation and entered following coefficients:\r\n" +
                          $"a={a}, b = {b} and c = {c}\r\nThe equation: {a}x^2+{b}x+{c}=0\r\nThe result is: " + solving;

            log.WriteInAFile(line);


            Console.WriteLine(solving);
        }
Exemplo n.º 2
0
        public void GetCoffOfLinearEq()
        {
            Console.WriteLine("You chose the linear type of equation and you should enter two coefficients, a and d (integer or real numbers):\n" +
                              "ax+b=0");
            Console.WriteLine("Enter the first coefficient: ");
            double b = CheckTheDouble();

            Console.WriteLine("Enter the second coefficient: ");
            double c = CheckTheDouble();

            Solving trySolve = new Solving(0, b, c);
            String  solving  = trySolve.FindRoots();

            Logg   log  = new Logg();
            String line = "The user chose the linear type of equation and entered following coefficients:\r\n" +
                          $"a={b} and b = {c}\r\nThe equation: {b}x+{c}=0\r\nThe result is: " + solving;

            log.WriteInAFile(line);

            Console.WriteLine(solving);
        }