Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

новая папка / voditeli

.txt
Скачиваний:
3
Добавлен:
12.11.2022
Размер:
1.57 Кб
Скачать

internal class ClassAutoMan
{
public List<string> nameAutoman = new List<string>() { "Иван", "Петр", "Григорий" };
public List<int> ageAutoman = new List<int>() { 26, 32, 38 };
public List<int> stazhAutoman = new List<int>() { 2, 6, 12 };
public List<string> zanatostAutoman = new List<string>() { "нет", "нет", "нет" };


public void PrintAutoman()
{
Console.WriteLine("Водители: ");
for (int i = 0; i < nameAutoman.Count; i++)
{
Console.WriteLine($"{i + 1}. Имя: {nameAutoman[i]}. Возраст: {ageAutoman[i]}. Водительский опыт(в годах): {stazhAutoman[i]}. Занят: {zanatostAutoman[i]}");
}
}

public void DeleteAutoman(int index)
{
nameAutoman.RemoveAt(index - 1);
ageAutoman.RemoveAt(index - 1);
stazhAutoman.RemoveAt(index - 1);
zanatostAutoman.RemoveAt(index - 1);
Console.WriteLine("Водитель успешно удален");
}

public void AddAutoman(string name, int age, int XP)
{
nameAutoman.Add(name);
ageAutoman.Add(age);
stazhAutoman.Add(XP);
zanatostAutoman.Add("Свободен");
Console.WriteLine("Водитель успешно добавлен");
}




public void Start()
{
Console.WriteLine($"");
}
}
Соседние файлы в папке новая папка