/// <summary> /// Program entry point. /// </summary> private static void Main() { try { Console.WriteLine(CalculateTriangleArea(3, 4, 5)); Console.WriteLine(ConvertDigitToString(5)); Console.WriteLine(Max(5, -1, 3, 2, 14, 2, 3)); PrintAsNumber(1.3); PrintAsPercent(0.75,-10); PrintAlligned(2.30); PrintAlligned(1.234, 10); Console.WriteLine(CalcDistance(3, -1, 3, 2.5)); Console.WriteLine("Horizontal? " + FormHorizontalLine(3, -1, 3, 2.5)); Console.WriteLine("Vertical? " + FormVerticalLine(3, -1, 3, 2.5)); Student peter = new Student("Peter", "Ivanov", "Sofia", DateTime.Parse("17.03.1992")); Student stella = new Student("Stella", "Markova", "Vidin", DateTime.Parse("03.11.1993"), "Gamer, high results."); Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella)); } catch (Exception e) { Console.WriteLine(e.Message + e.StackTrace); } }
/// <summary> /// Checks if Birthday of this Student instance is greater than another Student instance. /// </summary> /// <param name="student">Second Student instance.</param> /// <returns>True if this.Birthday is greater.</returns> public bool IsOlderThan(Student student) { return this.Birthday < student.Birthday; }