From 9f08efb21bd0d66a5e68431e6271fa0a718969de Mon Sep 17 00:00:00 2001 From: Puzanova Date: Tue, 6 Oct 2026 15:52:54 +0300 Subject: [PATCH] new --- works/CSharp/lab-06/Program.cs | 60 +++++++++++++++++++++++++++++++ works/CSharp/lab-06/lab-06.csproj | 11 ++++++ works/CSharp/lab-06/lab-06.sln | 16 +++++++++ 3 files changed, 87 insertions(+) create mode 100644 works/CSharp/lab-06/Program.cs create mode 100644 works/CSharp/lab-06/lab-06.csproj create mode 100644 works/CSharp/lab-06/lab-06.sln diff --git a/works/CSharp/lab-06/Program.cs b/works/CSharp/lab-06/Program.cs new file mode 100644 index 0000000..254b6f6 --- /dev/null +++ b/works/CSharp/lab-06/Program.cs @@ -0,0 +1,60 @@ +using System; + +namespace lab06 +{ + class Pokemon + { + + private string name; + private int level; + private int hp; + + + public string Name + { + get { return name; } + set { name = value; } + } + + public int Level + { + get { return level; } + set { level = value; } + } + + public int HP + { + get { return hp; } + set { hp = value; } + } + + + public Pokemon(string name, int level, int hp) + { + this.name = name; + this.level = level; + this.hp = hp; + } + + + public void ShowInfo() + { + Console.WriteLine($"Имя: {name}, Уровень: {level}, HP: {hp}"); + } + } + + class Program + { + static void Main() + { + + Pokemon pokemon1 = new Pokemon("Пикачу", 5, 100); + Pokemon pokemon2 = new Pokemon("Сквиртл", 7, 90); + + Console.WriteLine("=== ПОКЕДЕКС ==="); + pokemon1.ShowInfo(); + pokemon2.ShowInfo(); + } + } +} + diff --git a/works/CSharp/lab-06/lab-06.csproj b/works/CSharp/lab-06/lab-06.csproj new file mode 100644 index 0000000..052e958 --- /dev/null +++ b/works/CSharp/lab-06/lab-06.csproj @@ -0,0 +1,11 @@ + + + + Exe + net10.0 + lab_06 + enable + enable + + + diff --git a/works/CSharp/lab-06/lab-06.sln b/works/CSharp/lab-06/lab-06.sln new file mode 100644 index 0000000..079edc1 --- /dev/null +++ b/works/CSharp/lab-06/lab-06.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab-06", "lab-06.csproj", "{E31A458F-ABCE-4E66-92B8-C39ECB503F82}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E31A458F-ABCE-4E66-92B8-C39ECB503F82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E31A458F-ABCE-4E66-92B8-C39ECB503F82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E31A458F-ABCE-4E66-92B8-C39ECB503F82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E31A458F-ABCE-4E66-92B8-C39ECB503F82}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal