Advertisement
JohnJuly

Homework38

Feb 29th, 2024 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.InteropServices;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Homework38
  9. {
  10.     internal class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             Player player = new Player("Russia", "('')", 95, 999);
  15.  
  16.             player.ShowInfo();
  17.         }
  18.     }
  19.  
  20.     class Player
  21.     {
  22.         private string _country;
  23.         private string _nickname;
  24.         private int _age;
  25.         private int _level;
  26.  
  27.         public Player(string country, string nickname, int age, int level)
  28.         {
  29.             _country = country;
  30.             _nickname = nickname;
  31.             _age = age;
  32.             _level = level;
  33.         }
  34.  
  35.         public void ShowInfo()
  36.         {
  37.             Console.WriteLine($"Страна игрока: {_country}\nИмя игрока: {_nickname}\n" +
  38.                 $"Возраст игрока: {_age}\nУровень игрока: {_level}");
  39.         }
  40.     }
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement