private static Modeliai <Auto> Panasus(Modeliai <Auto> masinos, double didz) { Modeliai <Auto> atsakymas = new Modeliai <Auto>(); for (masinos.Pradzia(); masinos.Yra(); masinos.Kitas()) { Auto masina = masinos.GautiD(); if (didz - masina.Kaina <= didz * 0.25) { atsakymas.DetiT(masina); } } return(atsakymas); }
private static Modeliai <Auto> Skaitymas(string filePath, out double didz) { didz = 0; Modeliai <Auto> Masinos = new Modeliai <Auto>(); using (StreamReader reader = new StreamReader(filePath)) { string line; while ((line = reader.ReadLine()) != null) { string[] values = line.Split(';'); if (didz < double.Parse(values[2])) { didz = double.Parse(values[2]); } Auto temp = new Auto(values[0], values[1], double.Parse(values[2])); Masinos.DetiT(temp); } } return(Masinos); }