BasicKnowledgeCSharp/LessonsAndTasks/Lesson 56 - Методы и классы, ООП, вызов метода объекта класса/Student.cs
Dvurechensky 058c8f2679 1.0
Main
2024-10-05 09:59:53 +03:00

26 lines
703 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
class Student
{
/// <summary>
/// Cпециальная структура для описания объекта, создания уникальных id
/// </summary>
public Guid id;
public string firstName;
public string lastName;
public string middleName;
public int age;
public string group;
public void Print()
{
Console.WriteLine($"id: {id}, \nfirstName: {firstName},\n" +
$"lastName: {lastName}, \nmiddleName: {middleName},\n" +
$"age: {age}, \ngroup: {group}");
}
public string GetFullName()
{
return $"{lastName} {firstName} {middleName}";
}
}