Сориентировать программу к обьектно ориентированному программированию - C#

Узнай цену своей работы

Формулировка задачи:

Имеется код
List<string[]> lines = File.ReadAllLines("1.txt", Encoding.Default).Select(l => l.Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries)).ToList();
            var result = lines.OrderBy(l => int.Parse(l[1])).GroupBy(l => l[2]);
            foreach (var g in result)
            {
                Console.WriteLine(g.Key);
                string s = string.Join(", ", g.Select(n => n[0]));
                Console.WriteLine(s);
            }
нужно сделать (я так представляю себе) в отдельном классе. Как это можно сделать? Покидайте ссылок что почитать?

Решение задачи: «Сориентировать программу к обьектно ориентированному программированию»

textual
Листинг программы
(16:13) Invalid token 'foreach' in class, struct, or interface member declaration
(16:28) ; expected
(16:37) Invalid token ')' in class, struct, or interface member declaration
(18:34) Invalid token '(' in class, struct, or interface member declaration
(18:40) Invalid token ')' in class, struct, or interface member declaration
(20:34) Invalid token '(' in class, struct, or interface member declaration
(20:36) Invalid token ')' in class, struct, or interface member declaration
(23:23) Expected class, delegate, enum, interface, or struct
(23:40) Identifier expected
(23:42) Expected class, delegate, enum, interface, or struct
(25:33) Expected class, delegate, enum, interface, or struct
(27:5) Type or namespace definition, or end-of-file expected
(28:1) Type or namespace definition, or end-of-file expected

ИИ поможет Вам:


  • решить любую задачу по программированию
  • объяснить код
  • расставить комментарии в коде
  • и т.д
Попробуйте бесплатно

Оцени полезность:

6   голосов , оценка 4 из 5
Похожие ответы