Example #1
0
        static void Main(string[] args)
        {
            LeitorCSV     leitorCSVMapa       = new LeitorCSV(@"../mapa.csv");
            EscritorCSV   escritorCSVNovoMapa = new EscritorCSV(@"mapa2.csv");
            List <Cidade> listaDeCidades      = leitorCSVMapa.LerTodasAsLinhas();

            BubbleSort ordenador = new BubbleSort();

            ordenador.orderna(listaDeCidades);

            escritorCSVNovoMapa.EscreverTodasAsLinhas(leitorCSVMapa.getCabecalho(), listaDeCidades);
        }
Example #2
0
        static void Main(string[] args)
        {
            LeitorCSV     leitorCSVMapa       = new LeitorCSV(@"../mapa.csv");
            EscritorCSV   escritorCSVNovoMapa = new EscritorCSV(@"mapa2.csv");
            List <Cidade> linhasAntigas       = leitorCSVMapa.LerTodasAsLinhas();

            List <Cidade> linhasNovas = new List <Cidade> ();

            foreach (Cidade cidade in linhasAntigas)
            {
                Cidade novaCidade = new Cidade(cidade.getCidade(), cidade.getPopulacao() * 2);
                linhasNovas.Add(novaCidade);
            }
            escritorCSVNovoMapa.EscreverTodasAsLinhas(leitorCSVMapa.getCabecalho(), linhasNovas);
        }