diff --git a/works/lab-02/Readme.md b/works/lab-02/Readme.md index 9756237..9ba09af 100644 --- a/works/lab-02/Readme.md +++ b/works/lab-02/Readme.md @@ -1,15 +1,113 @@ # Лабораторная работа №2 -* **Студент:** [ФИО] -* **Вариант / Карточка:** [Например: #025 Pikachu] +* **Студент:** [Мастио Вячеслав Алексеевич] --- ## Ключевой код +*Первое задание* ```csharp -// Самая важная часть реализации (методы, структуры, логика) -public class Card +public class lab2_1_2 { - public string Name { get; set; } - public int Hp { get; set; } + static void Main(string[] args) + { + int balance = 1500; + int potion_price = 200; + Console.Write("Количество зелий для покупки: "); + int count_potion = int.Parse(Console.ReadLine()); + + int end_price = potion_price * count_potion; + Console.WriteLine($"Итоговая сумма заказа: {end_price}"); + + int end_balance = balance - end_price; + Console.WriteLine($"Итоговый баланс: {end_balance}"); + + } + } +``` +--- +*Второе задание* +```csharp +public class lab2_2_1 +{ + static void Main(string[] args) + { + int hp = int.Parse(Console.ReadLine()); + + if (hp >= 50) + { + Console.WriteLine("Покемон полон сил и готов к бою!"); + } + else if (hp >= 21 && hp <= 50) + { + Console.WriteLine("Покемон ранен, будьте осторожны."); + } + else if (hp >= 1 && hp <= 20) + { + Console.WriteLine("Критическое состояние! Срочно используйте зелье!"); + } + else + { + Console.WriteLine("Покемон потерял сознание! Верните его в покебол."); + } + } +{ +``` +--- +*Третье задание* +```csharp +public class lab2_2_2 +{ + static void Main(string[] args) + { + Console.WriteLine("1 - Атака"); + Console.WriteLine("2 - Инвентарь"); + Console.WriteLine("3 - Сменить покемона"); + Console.WriteLine("4 - Побег"); + Console.WriteLine(); + Console.Write("Выберете действие которое хотите совершить:"); + int x = int.Parse(Console.ReadLine()); + Console.WriteLine(); + + + switch (x) + { + case 1: + Console.WriteLine("Покемон наносит быстрый удар!"); + break; + case 2: + Console.WriteLine("Вы открыли сумку и применили Зелье Лечения."); + break; + case 3: + Console.WriteLine("Вы отозвали покемона и выпустили нового!"); + break; + case 4: + Console.WriteLine("Вы успешно сбежали из боя!"); + break; + default: + Console.WriteLine( "Неизвестная команда! Вы пропустили ход."); + break; + } + } +} +``` +--- +*Чертвертое задание* +```csharp +public class lab2 +{ + static void Main(string[] args) + { + Console.WriteLine("=== Прокачка покемнов ==="); + Console.Write("Введите базовый урон: "); + int base_dmg = int.Parse(Console.ReadLine()); + Console.Write("Введите уровнь: "); + int lv = int.Parse(Console.ReadLine()); + int end_dmg = base_dmg + (lv * 5); + + Console.WriteLine($"Итоговая атака: {end_dmg}"); + + } +} +``` \ No newline at end of file diff --git a/works/lab-02/screenshots/задание 1.png b/works/lab-02/screenshots/задание 1.png deleted file mode 100644 index f4100ba..0000000 Binary files a/works/lab-02/screenshots/задание 1.png and /dev/null differ diff --git a/works/lab-02/screenshots/задание1.2.png b/works/lab-02/screenshots/задание1.2.png deleted file mode 100644 index 3ebd3b7..0000000 Binary files a/works/lab-02/screenshots/задание1.2.png and /dev/null differ