Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using TestConsole.Mathematic;
  3. using TestConsole.Tools;
  4.  
  5. namespace TestConsole
  6. {
  7.     public class Program
  8.     {
  9.         public static void Main(string[] args)
  10.         {
  11.             UserInput UserInput = new UserInput();
  12.  
  13.             double a = UserInput.GetDouble("Podaj a");
  14.             double b = UserInput.GetDouble("Podaj b");
  15.             double c = UserInput.GetDouble("Podaj c");
  16.  
  17.             var quadricFunctionCalculator = new QuadricFunctionCalculator();
  18.  
  19.             var results = quadricFunctionCalculator.GetResults(a,b,c);
  20.  
  21.             if (results.Count == 2)
  22.             {
  23.                 Console.WriteLine($"Funkcja ma dwa pierwiastki: {results[0]} oraz {results[1]}");
  24.             }
  25.             else if (results.Count == 1)
  26.             {
  27.                 Console.WriteLine($"Funkcja ma jeden pierwiastek: {results[0]}");
  28.             }
  29.             else
  30.             {
  31.                 Console.WriteLine("Funkcja nie ma pierwiastków");
  32.             }
  33.  
  34.             Console.ReadKey();
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement