コード例 #1
0
ファイル: Program.cs プロジェクト: fabiodevigilli/Aula1Turma2
 static void Main(string[] args)
 {
     cervejaController.AddCerveja(new Cerveja()
     {
         Id     = cervejaController.GetCervejas().Count + 1,
         Nome   = "Giomar",
         Litros = 1.0,
         Alcool = 4.1,
         Valor  = 7.5
     });
     cervejaController.GetCervejas().ForEach(x => Console.WriteLine($"{x.Id}, {x.Nome}, {x.Litros}, {x.Valor.ToString("C")}, {x.Alcool}."));
     Console.WriteLine($"Valor Total: {cervejaController.SomaValorCervejas().ToString("C")}");
     Console.WriteLine($"Total de litros bebidos: {cervejaController.SomaCervejasEmLitros()}");
     Console.ReadKey();
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: primjeanc/AulaT2
        static void Main(string[] args)
        {
            Cerveja cerveja = new Cerveja();

            cerveja.Nome   = "aaaaaah";
            cerveja.Litros = 0.750;
            cerveja.Alcool = 5.5;
            cerveja.Valor  = 5.95;

            cervejaController.AddCerveja(cerveja);

            cervejaController.GetCervejas().ForEach(i => Console.WriteLine($"ID{i.Id} Nome {i.Nome} Litros {i.Litros} Álcool {i.Alcool} Valor {i.Valor.ToString("C2")}"));

            Console.ReadKey();
            Console.WriteLine(cervejaController.SomaValorCervejas().ToString("C2"));
            Console.WriteLine(cervejaController.SomaCervejasEmLitros());

            Console.ReadKey();
        }
コード例 #3
0
 public static void TotalCervejasEmLitros()
 {
     Console.WriteLine($"Total de litros: {cervejaController.SomaCervejasEmLitros().ToString("N3")}");
 }