Exemple #1
0
 private static void Spausdinimas(Modeliai <Auto> masinos, string title, string path)
 {
     using (StreamWriter writer = new StreamWriter(path, true))
     {
         writer.WriteLine("<---*{0}*--->", title);
         string line = new string('-', 54);
         writer.WriteLine(line);
         for (masinos.Pradzia(); masinos.Yra(); masinos.Kitas())
         {
             writer.WriteLine(masinos.GautiD().ToString());
             writer.WriteLine(line);
         }
     }
 }
Exemple #2
0
        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);
        }