本文整理汇总了C#中Methods.Student.IsOlderThan方法的典型用法代码示例。如果您正苦于以下问题:C# Student.IsOlderThan方法的具体用法?C# Student.IsOlderThan怎么用?C# Student.IsOlderThan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Methods.Student
的用法示例。
在下文中一共展示了Student.IsOlderThan方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main()
{
Console.WriteLine(MathUtils.CalculateTriangleArea(3, 4, 5));
Console.WriteLine(NumberUtils.NumberToDigit(5));
Console.WriteLine(FindMax(5, -1, 3, 2, 14, 2, 3));
NumberUtils.PrintAsNumber(1.3, FormatSpecifier.Precision);
NumberUtils.PrintAsNumber(0.75, FormatSpecifier.Percent);
NumberUtils.PrintAsNumber(2.30, FormatSpecifier.RightAlignment);
double firstPointX = 3.0;
double firstPointY = -1.0;
double secondPointX = 3.0;
double secondPointY = 2.5;
double lineLength = MathUtils.CalculateDistanceBetweenTwoPoints(firstPointX, firstPointY, secondPointX, secondPointY);
Console.WriteLine(lineLength);
LineType lineType = MathUtils.GetLineType(firstPointX, firstPointY, secondPointX, secondPointY);
Console.WriteLine("Line type: " + lineType);
Student peter = new Student("Peter", "Ivanov", "Sofia", new DateTime(1992, 3, 17));
Student stela = new Student("Stela", "Markova", "Vidin", new DateTime(1993, 11, 3), new string[] { "Gamer", "High results" });
Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stela.FirstName, peter.IsOlderThan(stela));
}
示例2: Main
private static void Main()
{
Console.WriteLine(MathUtilities.CalculateTriangleArea(3, 4, 5));
Console.WriteLine(MathUtilities.DigitToWord(5));
Console.WriteLine(MathUtilities.FindMaxElement(5, -1, 3, 2, 14, 2, 3));
PrintNumberUtilities.PrintNumberWithTwoDecimalPlaces(1.3);
PrintNumberUtilities.PrintNumberAsPercentage(0.75);
PrintNumberUtilities.PrintNumberWithEightSpacecInfront(2.30);
Console.WriteLine(MathUtilities.CalculateDistance(3, -1, 3, 2.5));
bool horizontal = MathUtilities.IsHorizontal(-1, 2.5);
bool vertical = MathUtilities.IsVertical(3, 3);
Console.WriteLine("Horizontal? " + horizontal);
Console.WriteLine("Vertical? " + vertical);
Student peter = new Student("Peter", "Ivanov", "From Sofia, born at 17/03/1992");
Student stella = new Student("Stella", "Markova", "From Vidin, gamer, high results, born at 03.11.1993");
Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
}
示例3: 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));
}
示例4: Main
public static void Main()
{
Console.WriteLine(CalcTriangleArea(3, 4, 5));
Console.WriteLine(NumberToText(5));
Console.WriteLine(FindMax(5, -1, 3, 2, 14, 2, 3));
PrintAsNumber(1.3, "f");
PrintAsNumber(0.75, "%");
PrintAsNumber(2.30, "r");
bool horizontal, vertical;
Console.WriteLine(CalcDistance(3, -1, 3, 2.5, out horizontal, out vertical));
Console.WriteLine("Horizontal? " + horizontal);
Console.WriteLine("Vertical? " + vertical);
Student peter = new Student("Peter", "Ïvanov", "Sofia", new DateTime(1992, 3, 17));
Student stella = new Student("Stella", "Markova", "Vidin", new DateTime(1993, 11, 3));
var isOlderThan = peter.IsOlderThan(stella);
if (isOlderThan < 0)
{
Console.WriteLine("Is older");
}
else if (isOlderThan > 0)
{
Console.WriteLine("Is younger");
}
else
{
Console.WriteLine("Are on the same age");
}
}
示例5: 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));
}
示例6: Main
static void Main()
{
Console.WriteLine(CalcTriangleArea(3, 4, 5));
Console.WriteLine(NumbersZeroToNineWord(5));
Console.WriteLine(FindMax(5, -1, 3, 2, 14, 2, 3));
PrintAsFloat(1.3);
PrintAsPercentage(0.75);
PrintWithSpacesBefore(2.30);
Console.WriteLine(CalcDistance(3, -1, 3, 2.5));
Console.WriteLine("Horizontal? " + IsHorizaontal(3,3));
Console.WriteLine("Vertical? " + IsVertical(-1,2.5));
Student peter = new Student("Peter", "Ivanov",
new DateTime(1992, 03, 03), "From Sofia");
Student stella = new Student("Stella", "Markova",
new DateTime(1993, 11, 03), "From Vidin, gamer, high results");
Console.WriteLine("{0} older than {1} -> {2}",
peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
}
示例7: Main
public static void Main()
{
Console.WriteLine(Methods.CalcTriangleArea(3, 4, 5));
Console.WriteLine(Methods.DigitAsWord(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, vertical;
Console.WriteLine(Methods.CalcDistance(3, -1, 3, 2.5, out horizontal, out vertical));
Console.WriteLine("Horizontal? {0}", horizontal ? "true" : "false");
Console.WriteLine("Vertical? {0}", vertical ? "true" : "false");
var peter = new Student()
{
FirstName = "Peter",
LastName = "Ivanov",
};
peter.OtherInfo = "From Sofia, born at 17.03.1992";
var 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) ? "true" : "false");
}
示例8: Main
static void Main()
{
Console.WriteLine(CalcTriangleArea(3, 4, 5));
Console.WriteLine(NumberToDigit(5));
int[] arrayOfIntegers = { 5, -1, 3, 2, 14, 2, 3 };
Console.WriteLine(FindMax(arrayOfIntegers));
PrintAsNumber(1.3, "f");
PrintAsNumber(0.75, "%");
PrintAsNumber(2.30, "r");
bool horizontal, vertical;
Console.WriteLine(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" };
peter.OtherInfo = "From Sofia";
peter.YearBorn = 1992;
Student stella = new Student() { FirstName = "Stella", LastName = "Markova" };
stella.OtherInfo = "From Vidin, gamer, high results";
stella.YearBorn = 1993;
Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
}
示例9: Main
public static void Main()
{
try
{
Console.WriteLine(CalcTriangleArea(3, 4, 5));
Console.WriteLine(NumberToLetters(5));
Console.WriteLine(FindMax(5, -1, 3, 2, 14, 2, 3));
PrintAsNumber(1.3, "f");
PrintAsNumber(0.75, "%");
PrintAsNumber(2.30, "r");
bool horizontal, vertical;
Console.WriteLine(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" };
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));
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
示例10: Main
private static void Main()
{
Console.WriteLine(Methods.CalcTriangleArea(3, 4, 5));
Console.WriteLine(Methods.NumberToDigit(5));
Console.WriteLine(Methods.FindMax(5, -1, 3, 2, 14, 2, 3));
Methods.PrintAsAbsoluteNumber(1.3);
Methods.PrintAsPercentage(0.75);
Methods.PrintAsRightAlignedNumber(2.30);
bool horizontal, vertical;
double sideA = 3;
double sideB = -1;
double sideC = 3;
double sideD = 2.5;
Console.WriteLine(Methods.CalcDistance(sideA, sideB, sideC, sideD));
Methods.CheckHorizontal(sideA, sideC, out horizontal);
Methods.CheckVertical(sideB, sideD, out vertical);
Console.WriteLine("Horizontal? " + horizontal);
Console.WriteLine("Vertical? " + vertical);
Student peter = new Student() { FirstName = "Peter", LastName = "Ivanov", OtherInfo = "From Sofia", BirthDate = new DateTime(1992, 3, 17) };
Student stella = new Student() { FirstName = "Stella", LastName = "Markova", OtherInfo = "From Vidin, gamer, high results", BirthDate = new DateTime(1993, 3, 11) };
Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
}
示例11: 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));
}
示例12: Main
public 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");
bool horizontal, vertical;
Console.WriteLine(CalculateDistanceBetweenTwoPoints(3, -1, 3, 2.5));
CheckingIsHorizontalOrVertical(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" };
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";
bool isOlderThan = peter.IsOlderThan(stella);
Console.WriteLine(
"{0} older than {1} -> {2}",
peter.FirstName,
stella.FirstName,
isOlderThan);
}
示例13: Main
public static void Main()
{
Console.WriteLine(CalcTriangleArea(3, 4, 5));
Console.WriteLine(NumberToDigit(5));
Console.WriteLine(FindMax(5, -1, 3, 2, 14, 2, 3));
PrintNumberWithPrecision(1.3);
PrintNumberAsPercentage(0.75);
PrintNumberAlignedRight(2.30);
bool horizontal, vertical;
Console.WriteLine(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" };
peter.DateOfBirth = new DateTime(1992, 3, 17);
peter.OtherInfo = "From Sofia";
Student stella = new Student() { FirstName = "Stella", LastName = "Markova" };
stella.DateOfBirth = new DateTime(1993, 11, 3);
stella.OtherInfo = "From Vidin, gamer, high results";
Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
}
示例14: Main
private static void Main()
{
Console.WriteLine(Methods.CalculateTriangleArea(3, 4, 5));
Console.WriteLine(Methods.NumberToDigit(5));
Console.WriteLine(Methods.FindMaxElement(5, -1, 3, 2, 14, 2, 3));
Methods.PrintNumber(1.3, "f");
Methods.PrintNumber(0.75, "%");
Methods.PrintNumber(2.30, "r");
double x1 = 3;
double y1 = -1;
double x2 = 3;
double y2 = 2.5;
bool horizontal = Methods.ArePointsVertical(x1, x2);
bool vertical = Methods.ArePointsHorizontal(y1, y2);
Console.WriteLine(Methods.CalculateDistanceBetweenPoints(x1, y1, x2, y2));
Console.WriteLine("Horizontal? " + horizontal);
Console.WriteLine("Vertical? " + vertical);
Student peter = new Student { FirstName = "Peter", LastName = "Ivanov" };
peter.Info = "From Sofia, born at 17.03.1992";
Student stella = new Student { FirstName = "Stella", LastName = "Markova" };
stella.Info = "From Vidin, gamer, high results, born at 03.11.1993";
Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
}
示例15: Main
public static void Main()
{
try
{
Console.WriteLine(CalculationTriangleArea(3, 4, 5));
Console.WriteLine(ConvertNumberToDigit(5));
Console.WriteLine(FindMaxElementOfArray(5, -1, 3, 2, 14, 2, 3));
Console.WriteLine();
PrintAsNumberInSpecialFormat(1.3, "f");
PrintAsNumberInSpecialFormat(0.75, "%");
PrintAsNumberInSpecialFormat(2.30, "r");
Console.WriteLine();
var peter = new Student("Peter", "Ivanov", "From Sofia, born at 17.03.1992");
var stella = new Student("Stella", "Markova", "From Vidin, gamer, high results, born at 03.11.1993");
Console.WriteLine("{0} older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
Console.WriteLine();
bool horizontal, vertical;
Console.WriteLine(CalculationDistance(3, -1, 5, 2.5, out horizontal, out vertical));
Console.WriteLine("Horizontal? " + horizontal);
Console.WriteLine("Vertical? " + vertical);
}
catch (ArgumentNullException ex)
{
Console.WriteLine(ex.Message);
}
catch (ArgumentException ex)
{
Console.WriteLine(ex.Message);
}
catch (InvalidOperationException ex)
{
Console.WriteLine(ex.Message);
}
}