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(); }
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(); }
public static void TotalCervejasEmLitros() { Console.WriteLine($"Total de litros: {cervejaController.SomaCervejasEmLitros().ToString("N3")}"); }