namespace TestConsoleApp1
public string Name { get; private set; }
public string Surname { get; private set; }
public string Id { get; private set; }
public double Amount { get; private set; }
public Person(string name, string surname, string id)
public string IncreaseAmount(double count)
public string DecreaseAmount(double count)
static void ChangePersonInfo(ref Person person)
Console.WriteLine("Введите Ваше имя: ");
string name = Console.ReadLine();
Console.WriteLine("Ввведите Вашу фамилию: ");
string surname = Console.ReadLine();
Console.WriteLine("Введите № ИД");
string IdNumber = Console.ReadLine();
person = new Person(name, surname, IdNumber);
static void Main(string[] args)
ChangePersonInfo(ref person);
Console.WriteLine("1 - Посмотреть баланс");
Console.WriteLine("2 - Увеличить баланс");
Console.WriteLine("3 - Уменьшить баланс");
Console.WriteLine("4 - Изменить введеные данные");
Console.WriteLine("0 - Выход");
string posmotretBalans = Console.ReadLine();
switch (Convert.ToInt32(posmotretBalans))
Console.WriteLine("баланс " + person.Amount);
Console.WriteLine("Введите сумму: ");
if(Double.TryParse(Console.ReadLine(), out double amount))
Console.WriteLine(person.IncreaseAmount(amount));
Console.WriteLine("Parse error");
Console.WriteLine("Введите сумму: ");
if (Double.TryParse(Console.ReadLine(), out amount))
Console.WriteLine(person.DecreaseAmount(amount));
Console.WriteLine("Parse error");
ChangePersonInfo(ref person);