generated from admin/template
First commit
This commit is contained in:
+82
-10
@@ -1,15 +1,87 @@
|
||||
# Лабораторная работа №1
|
||||
|
||||
* **Студент:** [ФИО]
|
||||
* **Вариант / Карточка:** [Например: #025 Pikachu]
|
||||
|
||||
---
|
||||
# Тема: Введение в язык C#. Переменные, базовые типы данных и консольный ввод/вывод информации
|
||||
|
||||
## Ключевой код
|
||||
```csharp
|
||||
// Самая важная часть реализации (методы, структуры, логика)
|
||||
public class Card
|
||||
// Задание 1. Объявление переменных и статический вывод данных
|
||||
using System;
|
||||
|
||||
class Program {
|
||||
static void Main() {
|
||||
string pokemonName ="Charmander";
|
||||
string elementType = "Fire";
|
||||
int level = 1;
|
||||
int hp = 95;
|
||||
Console.WriteLine($"===Database== \n Pokemon: {pokemonName} \n Element: {elementType} \n Level: {level}| HP: {hp}");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Задание 2. Интерактивный ввод и динамическое формирование документов
|
||||
using System;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Hp { get; set; }
|
||||
public static void Main()
|
||||
{
|
||||
Console.Write("Введите имя тренера: ");
|
||||
string trainerName = Console.ReadLine() ;
|
||||
Console.Write("Введите имя покемона: ");
|
||||
string pokemonName = Console.ReadLine();
|
||||
Console.Write("Введите стихию: ");
|
||||
string elementType = Console.ReadLine();
|
||||
Console.Write("Введите регион: ");
|
||||
string regionName = Console.ReadLine();
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine($"****************************************\n " +
|
||||
$"ПАСПОРТ ПОКЕМОНА \n Тренер: {trainerName} (Регион: {regionName})\n " +
|
||||
$"Покемон: {pokemonName} [ Стихия: {elementType}] \n" +
|
||||
$"**************************************** ");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Техническое задание: Оцифровка карточки Pokémon TCG
|
||||
namespace stage1;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.Write("стадия развития: ");
|
||||
string stage = Console.ReadLine();
|
||||
Console.Write("имя покемона: ");
|
||||
string name = Console.ReadLine();
|
||||
Console.Write("вид покемона: ");
|
||||
string category = Console.ReadLine();
|
||||
Console.Write("название первой атаки: ");
|
||||
string attack1Name = Console.ReadLine();
|
||||
Console.Write("эффект первой атаки: ");
|
||||
string attack1Desc = Console.ReadLine();
|
||||
Console.Write("название второй атаки: ");
|
||||
string attack2Name = Console.ReadLine();
|
||||
Console.Write("эффект второй атаки: ");
|
||||
string attack2Desc = Console.ReadLine();
|
||||
Console.Write("уязвимость: ");
|
||||
string weakness = Console.ReadLine();
|
||||
Console.Write("устойчивость: ");
|
||||
string resistance = Console.ReadLine();
|
||||
|
||||
int hp = 60;
|
||||
int number = 25;
|
||||
double height = 0.4;
|
||||
double weight = 6.0;
|
||||
int attack2Damage = 20;
|
||||
int retreatCost = 1;
|
||||
|
||||
Console.Clear();
|
||||
Console.WriteLine($"====================================================================== \n [{stage}] {name,-42} ОЖ: {hp} [⚡] \n " +
|
||||
$"---------------------------------------------------------------------- \n" +
|
||||
$" № {number} | Вид: {category} | Рост: {height} м | Вес: {weight} кг \n" +
|
||||
$"---------------------------------------------------------------------- \n " +
|
||||
$"[Атака 1] {attack1Name} \n Эффект: {attack1Desc} \n \n" +
|
||||
$"[Атака 2] {attack2Name,-42} Урон: {attack2Damage} \n Эффект: {attack2Desc} \n " +
|
||||
$"---------------------------------------------------------------------- \n" +
|
||||
$"Слабость: {weakness} \n Устойчивость: {resistance} \n Отступление: {retreatCost} \n" +
|
||||
$"======================================================================");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
class Program {
|
||||
static void Main() {
|
||||
string pokemonName ="Charmander";
|
||||
string elementType = "Fire";
|
||||
int level = 1;
|
||||
int hp = 95;
|
||||
Console.WriteLine($"===Database== \n Pokemon: {pokemonName} \n Element: {elementType} \n Level: {level}| HP: {hp}");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
using System;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Console.Write("Введите имя тренера:\n");
|
||||
string trainerName = Console.ReadLine() ;
|
||||
Console.Write("Введите имя покемона:\n");
|
||||
string pokemonName = Console.ReadLine();
|
||||
Console.Write("Введите стихию:\n");
|
||||
string elementType = Console.ReadLine();
|
||||
Console.Write("Введите регион:\n");
|
||||
string regionName = Console.ReadLine();
|
||||
Console.WriteLine($"****************************************\n ПАСПОРТ ПОКЕМОНА \n Тренер: {trainerName} (Регион: {regionName})\n Покемон: {pokemonName} [ Стихия: {elementType}] \n**************************************** ");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<Properties>
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<BreakpointStore />
|
||||
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="stage1/Program.cs">
|
||||
<Files>
|
||||
<File FileName="stage1/Program.cs" Line="1" Column="1" />
|
||||
</Files>
|
||||
<Pads>
|
||||
<Pad Id="ProjectPad">
|
||||
<State name="__root__">
|
||||
<Node name="stage1" expanded="True">
|
||||
<Node name="stage1" expanded="True">
|
||||
<Node name="Program.cs" selected="True" />
|
||||
</Node>
|
||||
</Node>
|
||||
</State>
|
||||
</Pad>
|
||||
</Pads>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MultiItemStartupConfigurations />
|
||||
</Properties>
|
||||
@@ -0,0 +1 @@
|
||||
{"Format":1,"ProjectReferences":[],"MetadataReferences":[],"Files":["/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/Program.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.GlobalUsings.g.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.AssemblyInfo.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.AssemblyInfo.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.AssemblyInfo.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.AssemblyInfo.cs"],"BuildActions":["Compile","Compile","Compile","Compile","Compile","Compile","Compile"],"Analyzers":["/usr/local/share/dotnet/sdk/7.0.317/Sdks/Microsoft.NET.Sdk/analyzers/Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll","/usr/local/share/dotnet/sdk/7.0.317/Sdks/Microsoft.NET.Sdk/analyzers/Microsoft.CodeAnalysis.NetAnalyzers.dll"],"AdditionalFiles":[],"EditorConfigFiles":["/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.GeneratedMSBuildEditorConfig.editorconfig"],"DefineConstants":["TRACE","DEBUG","NET","NET10_0","NETCOREAPP","NET5_0_OR_GREATER","NET6_0_OR_GREATER","NET7_0_OR_GREATER","NETCOREAPP1_0_OR_GREATER","NETCOREAPP1_1_OR_GREATER","NETCOREAPP2_0_OR_GREATER","NETCOREAPP2_1_OR_GREATER","NETCOREAPP2_2_OR_GREATER","NETCOREAPP3_0_OR_GREATER","NETCOREAPP3_1_OR_GREATER"],"IntermediateAssembly":"/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.dll"}
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "stage1", "stage1\stage1.csproj", "{DE0CB194-B073-4AE3-97D0-1DF92131C4D8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DE0CB194-B073-4AE3-97D0-1DF92131C4D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DE0CB194-B073-4AE3-97D0-1DF92131C4D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DE0CB194-B073-4AE3-97D0-1DF92131C4D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DE0CB194-B073-4AE3-97D0-1DF92131C4D8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,44 @@
|
||||
namespace stage1;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.Write("стадия развития: \n ");
|
||||
string stage = Console.ReadLine();
|
||||
Console.Write("имя покемона: \n ");
|
||||
string name = Console.ReadLine();
|
||||
Console.Write("вид покемона: \n ");
|
||||
string category = Console.ReadLine();
|
||||
Console.Write("название первой атаки: \n ");
|
||||
string attack1Name = Console.ReadLine();
|
||||
Console.Write("эффект первой атаки: \n ");
|
||||
string attack1Desc = Console.ReadLine();
|
||||
Console.Write("название второй атаки: \n ");
|
||||
string attack2Name = Console.ReadLine();
|
||||
Console.Write("эффект второй атаки: \n ");
|
||||
string attack2Desc = Console.ReadLine();
|
||||
Console.Write("уязвимость: \n ");
|
||||
string wekness = Console.ReadLine();
|
||||
Console.Write("устойчивость: \n ");
|
||||
string resistsnce = Console.ReadLine();
|
||||
|
||||
int hp = 60;
|
||||
int number = 25;
|
||||
double height = 0.4;
|
||||
double weight = 6.0;
|
||||
int attack2Damage = 20;
|
||||
int retreatCost = 1;
|
||||
|
||||
Console.Clear();
|
||||
Console.WriteLine($"====================================================================== \n [{stage}] {name,-42} ОЖ: {hp} [⚡] \n " +
|
||||
$"---------------------------------------------------------------------- \n" +
|
||||
$" № {number} | Вид: {category} | Рост: {height} м | Вес: {weight} кг \n" +
|
||||
$"---------------------------------------------------------------------- \n " +
|
||||
$"[Атака 1] {attack1Name} \n Эффект: {attack1Desc} \n \n" +
|
||||
$"[Атака 2] {attack2Name,-42} Урон: {attack2Damage} \n Эффект: {attack2Desc} \n " +
|
||||
$"---------------------------------------------------------------------- \n" +
|
||||
$"Слабость: {wekness} \n Устойчивость: {resistsnce} \n Отступление: {retreatCost} \n" +
|
||||
$"======================================================================");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user