public static void Main() { Console.WriteLine(Calculator.CalculateTriangleArea(3, 4, 5)); Console.WriteLine(Formatter.ConvertingNumberToDigit(5)); Console.WriteLine(Calculator.FindMax(5, -1, 3, 2, 14, 2, 3)); Formatter.FormatNumber(1.3, "f"); Formatter.FormatNumber(0.75, "%"); Formatter.FormatNumber(2.30, "r"); bool horizontal, vertical; Console.WriteLine(Calculator.CalcDistance(3, -1, 3, 2.5, out horizontal, out vertical)); Console.WriteLine("Horizontal? " + horizontal); Console.WriteLine("Vertical? " + vertical); Student peter = new Student { FirstName = "Peter", LastName = "Ivanov", OtherInfo = "From Sofia, born at 17.03.1992" }; Student stella = new Student { FirstName = "Stella", LastName = "Markova", OtherInfo = "From Vidin, gamer, high results, born at 03.11.1993" }; Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThanOther(stella)); }
public static void Main() { // Test Calculator methods var area = Calculator.CalcTriangleArea(3, 4, 5); Console.WriteLine(area); var digitAsString = Calculator.ConvertDigitToString(5); Console.WriteLine(digitAsString); var numbers = new int[] { 5, -1, 3, 2, 14, 2, 3 }; var maxNumber = Calculator.FindMax(numbers); Console.WriteLine(maxNumber); var pointAX = 3; var pointAY = -1; var pointBX = 3; var pointBY = 2.5; bool isHorizontal = pointAY == pointBY; bool isVertical = pointAX == pointBX; Console.WriteLine("Horizontal? " + isHorizontal); Console.WriteLine("Vertical? " + isVertical); var distance = Calculator.CalcDistance(pointAX, pointAY, pointBX, pointBY); Console.WriteLine(distance); // Test Printer methods Printer.PrintAsNumber(1.3, FormatType.FixedPoint); Printer.PrintAsNumber(0.75, FormatType.Percent); Printer.PrintAsNumber(2.30, FormatType.FloatRight); // Test Studdent methods var peter = new Student("Peter", "Ivanov", new DateTime(1997, 10, 03), "From Sofia"); var stella = new Student("Stella", "Markova", new DateTime(1993, 11, 01), "From Vidin, gamer, high results"); Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella)); }
internal static void Main() { Console.WriteLine(Calculator.CalculateTriangleArea(3, 4, 5)); Console.WriteLine(Formater.ConvertNumberToDigit(9)); Console.WriteLine(Calculator.FindMax(50.2, -1, 3, 2, 14, 2, 3)); Formater.FormatNumber(1.3, "f"); Formater.FormatNumber(0.75, "%"); Formater.FormatNumber(2.30, "r"); double pointOneX = 4.5; double pointOneY = 4.5; double pointTwoX = 1; double pointTwoY = 4.5; Console.WriteLine("Distance: {0}", Calculator.CalculateDistance(pointOneX, pointOneY, pointTwoX, pointTwoY)); Console.WriteLine("Horizontal? " + Calculator.CheckIsHorizontal(pointOneY, pointTwoY)); Console.WriteLine("Vertical? " + Calculator.CheckIsVertical(pointOneX, pointTwoX)); Student peter = new Student() { FirstName = "Peter", LastName = "Ivanov" }; peter.OtherInfo = "From Sofia, born at 17.03.1992"; Student stella = new Student() { FirstName = "Stella", LastName = "Markova" }; stella.OtherInfo = "From Vidin, gamer, high results, born at 03.11.1993"; Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella)); }