当前位置: 首页>>代码示例>>C#>>正文


C# Methods.Student类代码示例

本文整理汇总了C#中Methods.Student的典型用法代码示例。如果您正苦于以下问题:C# Student类的具体用法?C# Student怎么用?C# Student使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Student类属于Methods命名空间,在下文中一共展示了Student类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        private static void Main()
        {
            Console.WriteLine(Methods.CalculateTriangleArea(3, 4, 5));

            Console.WriteLine(Methods.NumberToDigit(5));

            Console.WriteLine(Methods.FindMax(5, -1, 3, 2, 14, 2, 3));

            Methods.NumberWithPrecision(1.3);
            Methods.NumberAsPercentage(0.75);
            Methods.NumberRightAligned(2.30);

            bool isHorizontal = Methods.IsLineHorizontal(-1, 2.5);
            bool isVertical = Methods.IsLineVertical(3, 3);
            double distance = Methods.CalculateDistance(3, -1, 3, 2.5);
            Console.WriteLine(distance);
            Console.WriteLine("Horizontal? : " + isHorizontal);
            Console.WriteLine("Vertical? : " + isVertical);

            Student peter = new Student("Peter", "Ivanov", new DateTime(1992, 3, 17), "From Sofia");

            Student stella = new Student("Stella", "Markova", new DateTime(1993, 11, 3), "From Vidin, gamer, high results");

            Console.WriteLine("{0} older than {1} -> {2}",
                peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
        }
开发者ID:ivanvasilev,项目名称:Telerik-Academy-Homeworks,代码行数:26,代码来源:MainProgram.cs

示例2: IsOlderThan

        public bool IsOlderThan(Student other)
        {
            DateTime firstBirthDate = this.BirthDate;
            DateTime secondBirthDate = other.BirthDate;

            return firstBirthDate < secondBirthDate;
        }
开发者ID:MarinaGeorgieva,项目名称:TelerikAcademy,代码行数:7,代码来源:Student.cs

示例3: Main

        static void Main()
        {
            Console.WriteLine(CalcTriangleArea(3, 4, 5));

            Console.WriteLine(NumberToDigit(5));

            Console.WriteLine(FindMax(5, -1, 3, 2, 14, 2, 3));

            PrintAsNumber(1.3, "f");
            PrintAsNumber(0.75, "%");
            PrintAsNumber(2.30, "r");

            Console.WriteLine(CalcDistance(3, -1, 3, 2.5));
            Console.WriteLine("Horizontal? " + isHorizontal(3, 3));
            Console.WriteLine("Vertical? " + isVertical(-1, 2.5));

            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));
        }
开发者ID:titanXL,项目名称:SoftwareUniversity,代码行数:25,代码来源:Methods.cs

示例4: IsOlderThan

        public bool IsOlderThan(Student otherStudent)
        {
            DateTime firstDate = this.DateOfBirth;
            DateTime secondDate = otherStudent.DateOfBirth;

            return firstDate < secondDate;
        }
开发者ID:ivanvasilev,项目名称:Telerik-Academy-Homeworks,代码行数:7,代码来源:Student.cs

示例5: IsOlderThan

 /// <summary>
 /// Returns if the student is older than another.
 /// </summary>
 /// <param name="other">The other student.</param>
 /// <returns>If older.</returns>
 public bool IsOlderThan(Student other)
 {
     DateTime firstDate = ParseDateFromOtherInfo(this);
     DateTime secondDate = ParseDateFromOtherInfo(other);
     bool isOlder = firstDate > secondDate;
     return isOlder;
 }
开发者ID:klimentt,项目名称:Telerik-Academy,代码行数:12,代码来源:Student.cs

示例6: Main

        public static void Main()
        {
            Console.WriteLine(ExtensionMethods.CalcTriangleArea(3, 4, 5));

            Console.WriteLine(ExtensionMethods.NumberToDigit(5));

            Console.WriteLine(ExtensionMethods.FindMax(5, -1, 3, 2, 14, 2, 3));

            ExtensionMethods.PrintAsNumber(1.3, "f");
            ExtensionMethods.PrintAsNumber(0.75, "%");
            ExtensionMethods.PrintAsNumber(2.30, "r");

            bool horizontal, vertical;
            Console.WriteLine(ExtensionMethods.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.IsOlderThan(stella));
        }
开发者ID:zhecho1215,项目名称:Softuni,代码行数:33,代码来源:MainEntryPoint.cs

示例7: IsOlderThan

        public bool IsOlderThan(Student other)
        {
            DateTime firstDate = this.GetDateFromInfo(this.OtherInfo);
            DateTime secondDate = this.GetDateFromInfo(other.OtherInfo);

            return firstDate > secondDate;
        }
开发者ID:peterkirilov,项目名称:SoftUni-1,代码行数:7,代码来源:Student.cs

示例8: IsOlderThan

        public bool IsOlderThan(Student other)
        {
            DateTime firstDate = DateTime.Parse(this.OtherInfo.Substring(this.OtherInfo.Length - 10));
            DateTime secondDate = DateTime.Parse(other.OtherInfo.Substring(other.OtherInfo.Length - 10));

            return firstDate > secondDate;
        }
开发者ID:ivayloivanof,项目名称:HQC,代码行数:7,代码来源:Student.cs

示例9: Main

        private static void Main()
		{
			Console.WriteLine(Methods.CalcTriangleArea(3, 4, 5));

			Console.WriteLine(Methods.DigitToString(5));

			Console.WriteLine(Methods.FindMax(5, -1, 3, 2, 14, 2, 3));

			Methods.FormatNumber(1.3, "f");
			Methods.FormatNumber(0.75, "%");
			Methods.FormatNumber(2.30, "r");

			bool horizontal = Methods.IsHoryzontal(3, -1, 3, 2.5);
			bool vertical = Methods.IsVertical(3, -1, 3, 2.5);
			Console.WriteLine(Methods.CalcDistance(3, -1, 3, 2.5));
			Console.WriteLine("Horizontal? " + horizontal);
			Console.WriteLine("Vertical? " + vertical);

			Student peter = new Student("Peter", "Ivanov", "1992-03-17");
			peter.OtherInfo = "From Sofia";

			Student stella = new Student("Stella", "Markova", "1993-03-11");
			stella.OtherInfo = "From Vidin, gamer, high results";

			Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
		}
开发者ID:damy90,项目名称:Telerik-all,代码行数:26,代码来源:Tests.cs

示例10: Main

        static void Main()
        {
            Console.WriteLine(Methods.CalculateTriangleArea(3, 4, 5));
            Console.WriteLine(Methods.DigitToString(5));
            Console.WriteLine(Methods.FindMax(5, -1, 3, 2, 14, 2, 3));

            Methods.PrintAsFixedPoint(1.3);
            Methods.PrintAsPercent(0.75);
            Methods.PrintRightWithAlignmentEight(2.30);

            Point p1 = new Point(3, -1);
            Point p2 = new Point(3, 2.5);

            Console.WriteLine("Distance: " + Methods.CalculateDistanceBetweenTwoPoints(p1, p2));
            Console.WriteLine("Horizontal? " + Methods.IsSomeLineHorizontal(p1, p2));
            Console.WriteLine("Vertical? " + Methods.IsSomeLineVertical(p1, p2));

            Student peter = new Student() { FirstName = "Peter", LastName = "Ivanov", };
            peter.BirthDate = new DateTime(1992, 03, 17);
            peter.OtherInfo = "From Sofia";

            Student stella = new Student() { FirstName = "Stella", LastName = "Markova" };
            stella.BirthDate = new DateTime(1993, 11, 03);
            stella.OtherInfo = "From Vidin, gamer, high results";

            Console.WriteLine("{0} older than {1} -> {2}",
                peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
        }
开发者ID:Termininja,项目名称:TelerikAcademy,代码行数:28,代码来源:Demo.cs

示例11: IsOlderThan

 public bool IsOlderThan(Student other)
 {
     DateTime firstDate = getBirthDate();
     DateTime secondDate = getBirthDate();
     bool isFirstStudentOlder = (firstDate > secondDate);
     return isFirstStudentOlder;
 }
开发者ID:GStoykov,项目名称:TelerikAcademyHomeworks,代码行数:7,代码来源:Student.cs

示例12: Main

        public static void Main()
        {
            Console.WriteLine(Methods.CalculateTriangleArea(3, 4, 5));

            Console.WriteLine(Methods.NumberToDigitName(5));

            Console.WriteLine(Methods.FindMax(5, -1, 3, 2, 14, 2, 3));

            Methods.PrintAsNumber(1.3, "f");
            Methods.PrintAsNumber(0.75, "%");
            Methods.PrintAsNumber(2.30, "r");

            bool horizontal = Methods.IsLineHorizontal(-1, 2.5);
            bool vertical = Methods.IsLineVertical(3, 3);

            Console.WriteLine(Methods.CalculateDistance(3, -1, 3, 2.5));
            Console.WriteLine("Horizontal? " + horizontal);
            Console.WriteLine("Vertical? " + vertical);

            Student peter = new Student("Peter", "Ivanov", new DateTime(1992, 3, 17), "From Sofia");
            Student stella = new Student("Stella", "Markova", new DateTime(1993, 11, 3), "From Vidin, gamer, high results");

            Console.WriteLine(
                "{0} {1} older than {2} {3} -> {4}",
                peter.FirstName,
                peter.LastName,
                stella.FirstName,
                stella.LastName,
                peter.IsOlderThan(stella));
        }
开发者ID:MarinaGeorgieva,项目名称:TelerikAcademy,代码行数:30,代码来源:MainProgram.cs

示例13: Main

        static void Main()
        {
            //StatisticUtils Tests
            Console.WriteLine("StatisticUtils Tests");
            Console.WriteLine("The Max of the numbers '5, -1, 3, 2, 14, 2, 3' is :{0}", StatisticUtils.Max(5, -1, 3, 2, 14, 2, 3));
            Console.WriteLine();

            //StringUtils Tests
            Console.WriteLine("StringUtils Tests");
            Console.WriteLine("The digit 5 to string is: {0}", StringUtils.DigitToString(5));
            Console.WriteLine("Different Formats");
            Console.WriteLine(StringUtils.FormatNumber(1.3, "f"));
            Console.WriteLine(StringUtils.FormatNumber(0.75, "%"));
            Console.WriteLine(StringUtils.FormatNumber(2.30, "r"));
            Console.WriteLine();

            //GeometryUtils Tests
            Console.WriteLine("GeometryUtils Tests");
            Console.WriteLine("Trinagle with sides '3,4,5' has area: {0}", GeometryUtils.CalcTriangleArea(3, 4, 5));
            Console.WriteLine("Distance between the two lines is: {0}", GeometryUtils.CalcDistance(3, -1, 3, 2.5));
            Console.WriteLine("Horizontal? " + GeometryUtils.IsHorizontalLine(3, -1, 3.0, 2.5));
            Console.WriteLine("Vertical? " + GeometryUtils.IsVerticalLine(3, -1, 3.0, 2.5));
            Console.WriteLine();

            //Student Tests
            Console.WriteLine("Student Tests");
            Student peter = new Student(firstName: "Peter", lastName: "Ivanov", dateOfBirth: "17/03/1992");
            peter.OtherInfo = "From Sofia.";

            Student stella = new Student(firstName: "Stella", lastName:"Markova", dateOfBirth: "03/11/1993");
            stella.OtherInfo = "From Vidin, gamer, high results.";

            Console.WriteLine("{0} older than {1} -> {2}",
                peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
        }
开发者ID:NikolayGenov,项目名称:TelerikAcademy,代码行数:35,代码来源:Tests.cs

示例14: IsOlderThan

        public bool IsOlderThan(Student other)
        {
            DateTime firstDate, secondDate;

            if (this.OtherInfo == string.Empty || other.OtherInfo == string.Empty)
            {
                throw new ArgumentException("There is no info for some of the students!");
            }

            try
            {
                firstDate = DateTime.Parse(this.OtherInfo.Substring(this.OtherInfo.Length - 10));
            }
            catch (FormatException)
            {
                throw new ArgumentException("The info for the stdent doesn\'t contain birthdate in valid format!");
            }

            try
            {
                secondDate = DateTime.Parse(other.OtherInfo.Substring(other.OtherInfo.Length - 10));
            }
            catch (FormatException)
            {
                throw new ArgumentException("The info for the other stdent doesn\'t contain birthdate in valid format!");
            }

            bool isOlder = firstDate < secondDate;
            return isOlder;
        }
开发者ID:AyrFX,项目名称:Telerik-Academy-2015-HQC-Homeworks,代码行数:30,代码来源:Student.cs

示例15: Main

        public static void Main()
        {
            Console.WriteLine(CalcTriangleArea(3, 4, 5));

            Console.WriteLine(DigitToString(5));

            Console.WriteLine(FindMax(5, -1, 3, 2, 14, 2, 3));

            PrintAsNumber(1.3, 'f');
            PrintAsNumber(0.75, '%');
            PrintAsNumber(2.30, 'r');

            double x1 = 3;
            double y1 = -1;
            double x2 = 3;
            double y2 = 2.5;

            Console.WriteLine(CalcDistance(x1, y1, x2, y2));

            bool isHorizontal = AreEqual(y1, y2);
            bool isVertical = AreEqual(y1, y2);

            Console.WriteLine("Horizontal? " + isHorizontal);
            Console.WriteLine("Vertical? " + isVertical);

            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));
        }
开发者ID:hristo-iliev,项目名称:TelerikHW,代码行数:33,代码来源:Methods.cs


注:本文中的Methods.Student类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。