Ejemplo n.º 1
0
 public static void ListarCervejas()
 {
     cervejaController.GetCervejas().ForEach(i => Console.WriteLine($@"
          Id: {i.Id.ToString()}
          Nome: {i.Nome}
          Ml: {i.LitrosEmMl}
          % Alcoolico:{i.PercentAlcoolPerMl}
          Valor: {i.Valor.ToString("C")}
          =====================================
     "));
 }
Ejemplo n.º 2
0
 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)
        {
            CervejaController cervejaController = new CervejaController();

            cervejaController.GetCervejas().ForEach(x => Console.WriteLine($"Id {x.Id} Nome{x.Nome} Litros{x.Litros} Valor{x.Valor}"));

            Console.WriteLine("Digite nome da cerveja:");
            var n = Console.ReadLine();

            Console.WriteLine("Digite quantidade em ml da cerveja:");
            var l = double.Parse(Console.ReadLine()) / 1000;

            Console.WriteLine("Digite teor alcoólico:");
            var al = double.Parse(Console.ReadLine()) / 100;

            Console.WriteLine("Digite preço da cerveja:");
            var v = double.Parse(Console.ReadLine());

            Cerveja cerva = new Cerveja()
            {
                Nome   = n,
                Litros = l,
                Alcool = al,
                Valor  = v
            };



            Console.ReadKey();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            CervejaController controller = new CervejaController();

            controller.GetCervejas().ForEach(c => Console.WriteLine(c.Nome));
            Console.ReadKey();
        }
Ejemplo n.º 5
0
        static void ListaCerveja()
        {
            cervejaController.GetCervejas()
            .ToList <Cerveja>()
            .ForEach(x => Console.WriteLine(x.Nome));

            Console.ReadKey();
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            cervejaController.CadastrarCervejas(new Cerveja()

            {
                Id     = cervejaController.GetCervejas().Count + 1,
                Nome   = "Giomar",
                Litros = 0.600,
                Alcool = 7.5,
                Valor  = 0.98
            });
            cervejaController.GetCervejas().ForEach(i => Console.WriteLine($"{i.Id} {i.Nome} {i.Valor} {i.Litros} {i.Alcool}"));


            Console.WriteLine("Total litros" + cervejaController.ListaSomaLitros());
            Console.ReadKey();
        }
Ejemplo n.º 7
0
 static void listarCerveja()
 {
     cervejaController.GetCervejas().ForEach(i => Console.WriteLine($"ID:{i.Id}" +
                                                                    $"Nome: {i.Nome} " +
                                                                    $"Volume: {i.Litros} " +
                                                                    $"Teor Alcoólico: {i.Alcool} " +
                                                                    $"Preço: {i.Valor}"));
 }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            cervejaController.AdicionarCerveja(new Cerveja
            {
                Id = cervejaController.GetCervejas().Count, Nome = "Heineken", Valor = 3.99, Litros = 0.35, Alcool = 3.75
            });;


            cervejaController.GetCervejas().ForEach(x => Console.WriteLine($"Id: {x.Id} Cerveja: {x.Nome} Valor: {x.Valor.ToString("C")} Alcool: {x.Alcool} Litros: {x.Litros}"));

            Console.WriteLine($"Total Litros: {cervejaController.ValorTotalEmLitros()}");
            Console.WriteLine($"Valor Total: {cervejaController.ValorTotalCervejas().ToString("C")}");
            cervejaController.TesteBafometro();



            Console.ReadKey();
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            cervejaController.AdicionarCerveja(new Cerveja()
            {
                Id     = cervejaController.GetCervejas().Count + 1,
                Nome   = "Giomar",
                Litros = 0.600,
                Alcool = 8,
                Valor  = 15
            });

            cervejaController.GetCervejas().ForEach(x => Console.WriteLine($" ID {x.Id} Cerveja {x.Nome} Valor {x.Valor.ToString("C")} Teor Alcoolico {x.Alcool}"));

            Console.WriteLine("Total Litro:" + cervejaController.RetornarValorEmLitros());
            Console.WriteLine("Total Valor:" + cervejaController.RetornarValor().ToString("C"));

            Console.ReadKey();
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            cervejaController.adicionarCerveja2(new Cerveja()
            {
                Id     = cervejaController.GetCervejas().Count + 1,
                Nome   = "Giomar",
                Litros = 0.600,
                Alcool = 8,
                Valor  = 0.98
            });
            cervejaController.GetCervejas().
            ForEach(x =>
                    Console.WriteLine($" Id {x.Id} Nome --{x.Nome} Litros-- {x.Litros} Valor-- {x.Valor} Alcool-- {x.Alcool}"));

            Console.WriteLine("Total litros" + cervejaController.SomarTotalDeLitros());
            Console.WriteLine("Total Valor " + cervejaController.SomarTotalLista().ToString("C"));

            Console.ReadKey();
        }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            cervejaController.AddCerveja(new Cerveja()
            {
                Nome = "Cerveja Skol"
            });

            cervejaController.GetCervejas().ToList <Cerveja>().ForEach(x => Console.WriteLine(x.Nome));
            Console.ReadKey();
        }
Ejemplo n.º 12
0
        static void Main(string[] args)
        {
            cervejaController.AdicionarCerveja(new Cerveja()
            {
                Id     = cervejaController.GetCervejas().Count + 1,
                Nome   = "Giomar",
                Litros = 600,
                Alcool = 8,
                Valor  = 0.98
            });


            cervejaController.GetCervejas().ForEach(x => Console.WriteLine($" Id: {x.Id} Nome: {x.Nome} Litros:{x.Litros} Valor: {x.Valor} Alcool: {x.Alcool}"));


            Console.WriteLine("Total litros: "
                              + cervejaController.RetornarLitros());
            Console.ReadKey();
        }
Ejemplo n.º 13
0
        static void Main(string[] args)
        {
            cervejaController.adicionarCerveja2(new Cerveja()
            {
                Id     = cervejaController.GetCervejas().Count + 1,
                Nome   = "Giomar",
                Litros = 0.600,
                Alcool = 7.5,
                Valor  = 0.98
            });

            cervejaController.GetCervejas().ForEach(x => Console.WriteLine($"Id: {x.Id} - Nome: {x.Nome} - Valor: {x.Valor} - Litros: {x.Litros} - Alcool: {x.Alcool}"));

            Console.WriteLine("Total litros " + cervejaController.SomarTotalDeLitros());
            Console.WriteLine("Total valor " + cervejaController.SomarTotalLista());


            Console.ReadKey();
        }
Ejemplo n.º 14
0
        static void Main(string[] args)
        {
            cervejaController.AdicionarCerveja(new Cerveja()
            {
                Id     = cervejaController.GetCervejas().Count + 1,
                Nome   = "Giomar",
                Litros = 0.6,
                Alcool = 8,
                Valor  = 0.98
            });

            cervejaController.GetCervejas().ForEach(x =>
                                                    Console.WriteLine($"Id {x.Id} Nome {x.Nome} Litro {x.Litros} Valor {x.Valor} Álcool {x.Alcool}"));


            Console.WriteLine("Total litros " + cervejaController.RetornaValorTotalListrosCerveja());
            Console.WriteLine("Total Valor " + cervejaController.RetornaValorTotalCervejas().ToString("C"));

            Console.ReadKey();
        }
Ejemplo n.º 15
0
        public static void MostrarLista()
        {
            //string template = $"Id: {0,3} Nome: {1,10} Valor: {2,4} Alcool: {3,4} Litros: {4,4}";
            //string formatado = string.Format(template,
            //    param.Id, param.Nome, param.Valor.ToString("C2"), param.Alcool, param.Litros);
            //cervejaControllerObject.GetCervejas().ForEach(x => Console.WriteLine
            //(formatado));

            cervejaControllerObject.GetCervejas().ForEach(x => Console.WriteLine
                                                              ($"Id: {x.Id} Nome: {x.Nome} Valor: {x.Valor} Alcool: {x.Alcool} Litros: {x.Litros}"));
        }
Ejemplo n.º 16
0
        static void Main(string[] args)
        {
            controllerCerveja.GetCervejas().ForEach(x => Console.WriteLine($"ID: {x.Id} NOME: {x.Nome}"));

            Console.WriteLine(controllerCerveja.ListaSomaValor());
            Console.WriteLine(controllerCerveja.ListaSomaLitros());

            Console.WriteLine("Cadastrar Cerveja no sistema: ");
            Console.WriteLine();
            Console.Write("Nome da Cerveja: ");

            var nomeCerveja = Console.ReadLine();

            Console.Write("Teor Alcolico: ");
            var alcoolCerveja = double.Parse(Console.ReadLine());

            Console.Write("Valor da Cerveja: ");
            var valorCerveja = double.Parse(Console.ReadLine());

            Console.Write("Litro da Cerveja: ");
            var litrosCerveja = double.Parse(Console.ReadLine());

            controllerCerveja.CadastrarCervejas(new Cerveja()
            {
                Nome   = nomeCerveja,
                Alcool = alcoolCerveja,
                Valor  = valorCerveja,
                Litros = litrosCerveja
            });
            Console.WriteLine("Cerveja Cadastrada com sucesso!");
            controllerCerveja.GetCervejas().ForEach(x => Console.WriteLine($"ID: {x.Id} NOME: {x.Nome}"));

            Thread.Sleep(1000);

            Console.WriteLine("-porcentagem por litro de sangue-");

            Console.WriteLine(controllerCerveja.CalcularPorcentagemSangue() + " Litros");
            //Console.WriteLine(controllerCerveja.CalcularPorcentagem() + " ");

            Console.ReadKey();
        }
Ejemplo n.º 17
0
        static void Main(string[] args)
        {
            cervejaController.AdicionarCerveja(new Cerveja()

            {
                Id     = cervejaController.GetCervejas().Count + 1,
                Nome   = "Giomar",
                Litros = 0.600,
                Alcool = 8,
                Valor  = 0.98
            });

            cervejaController.GetCervejas().
            ForEach(x =>
                    Console.WriteLine($"ID:{x.Id}  Nome: {x.Nome}  Litros: {x.Litros}ml  Valor: {x.Valor} reais  Álcool: {x.Alcool}%"));

            Console.WriteLine($"Total de litros:" + cervejaController.RetornaValorTotalListrosCerveja() + "L");
            Console.WriteLine("Valor total:" + cervejaController.RetornaValorTotalCervejas().ToString("C"));

            Console.ReadKey();
        }
Ejemplo n.º 18
0
        static void Main(string[] args)
        {
            cervejaController.AdicionarCervejas(new Cerveja()
            {
                Id     = cervejaController.GetCervejas().Count + 1,
                Nome   = "Juliana",
                Litros = 0.600,
                Alcool = 8,
                Valor  = 0.98
            });

            cervejaController.GetCervejas().ForEach
                (x => Console.WriteLine
                    ($"Id {x.Id} Nome: {x.Nome} Litros: " +
                    $"{x.Litros} Valor: {x.Valor} Alcool: {x.Alcool}"));

            Console.WriteLine("Total em litros: " + cervejaController.ValorTotalEmLitros());
            Console.WriteLine("Valor total: " + cervejaController.ValorTotal());

            Console.ReadKey();
        }
Ejemplo n.º 19
0
        static void Main(string[] args)
        {
            Cerveja cerveja = new Cerveja {
                Nome = "Cerveja Nova cerveja", Teor = 5.4, Tipo = "Pilsen"
            };

            controller.AddCerveja(cerveja);

            controller.GetCervejas().ToList().ForEach(c => Console.WriteLine(c.Nome));


            Console.ReadKey();
        }
Ejemplo n.º 20
0
        public static void TesteAlcool()
        {
            var lista = cervejaController.GetCervejas();

            Console.Write("Qual o seu peso? ");
            double weight = double.Parse(Console.ReadLine()) * 0.453592;

            Console.Write("Sexo (M/F): ");
            String gender = Console.ReadLine().ToLower();

            Console.Write("Esta bebendo faz quantas horas? ");
            double time = double.Parse(Console.ReadLine());

            Console.Write("Quantos tipos/variedade de cerveja você bebeu? ");
            Console.WriteLine(lista.Count.ToString());
            int    numDrinks  = lista.Count();
            double i          = 0;
            double bac        = 0;
            double currentBAC = 0;
            double widmark    = (gender.Equals('f') ? 0.55 : 0.68); //Quoeficiente relativo ao sexo



            double volume = 0;
            double abv    = 0;

            while ((i < numDrinks))
            {
                lista.ForEach(x =>
                {
                    volume += (x.Litros * 1000) / 29.5735; //converte mililitros para ounces
                    abv    += x.Alcool / 100;              // percentual de álcool
                });

                bac = (bac
                       + ((volume
                           * (abv * 5.14))
                          / (weight * widmark)));
                i++;
            }

            currentBAC = (bac - (0.015 * time)); //diminuição do percentual de álcool no sangue por hora.
            if ((currentBAC >= 0))
            {
                Console.WriteLine(("Sua graduação alcóolia é provavelmente " + currentBAC.ToString("N3")));
            }
            else
            {
                Console.WriteLine("Sua graduação alcóolica deve estar normal");
            }
        }
Ejemplo n.º 21
0
        static void Main(string[] args)
        {
            Console.WriteLine("Lista de Cervejas:");
            cervejaController.GetCervejas().ForEach(x => Console.WriteLine($"Id: {x.Id } Nome: {x.Nome} Litros: {x.Litros} Alcool: {x.Alcool} Valor: {x.Valor}"));
            Console.WriteLine("");
            Console.ReadKey();

            Console.WriteLine($"Total Valor: {cervejaController.RetornarValor()}");
            Console.ReadKey();

            Console.WriteLine("");
            Console.WriteLine($"Total Litros: {cervejaController.RetornarLitros()}");
            Console.ReadKey();
        }
Ejemplo n.º 22
0
        static void Main(string[] args)
        {
            //Cerveja.Cervejas.Add(new Cerveja() { Nome = "Golimar" });
            //Cerveja.SaveChanges();
            //Cerveja.Cervejas.ToList<Cerveja>().ForEach(x => Console.WriteLine(x.Nome));

            cerveja.AddCerveja(new Cerveja()
            {
                Nome = "Cerveja Skol"
            });

            cerveja.GetCervejas().ToList <Cerveja>().ForEach(x => Console.WriteLine(x.Nome));
            Console.ReadKey();
        }
Ejemplo n.º 23
0
        static void Main(string[] args)
        {
            cerveja.Nome = "Cerveja Skol";
            cerveja.Teor = 5.6;
            cerveja.Tipo = "Pilsen";
            controller.AddCerveja(cerveja);

            Console.WriteLine("Lista de Cervejas no Banco de Dados");

            string template = "|{0,3} | {1,-50} | {2,-20} | {3,3}|";

            controller.GetCervejas().ToList().ForEach(c => Console.WriteLine(String.Format(template, c.Id, c.Nome, c.Tipo, c.Teor)));

            Console.ReadKey();
        }
Ejemplo n.º 24
0
        static void Main(string[] args)
        {
            cervejaController.GetCervejas().ForEach(i =>
                                                    Console.WriteLine($"\r\n O Id é {i.Id}, a Cerveja é {i.Nome}, Litros {i.Litros}, teor alcoólico {i.Alcool}, valor {i.Valor.ToString("C")}."));

            Console.WriteLine($"\r\n O valor total da conta é: {cervejaController.ValorTotal().ToString("C")}.");

            Console.WriteLine($"\r\n A quantidade total em litros consumidos é: {cervejaController.LitrosTotal()} litros.");

            Console.ReadKey(true);

            TesteDeManguaca();



            Console.ReadKey(true);
        }
Ejemplo n.º 25
0
        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();
        }
Ejemplo n.º 26
0
        static void Main(string[] args)
        {
            //cerveja.Cervejas.Add(new Cerveja() {Nome = "Camila"});
            // cerveja.SaveChanges();

            // cerveja.Cervejas.ToList<Cerveja>()
            //.ForEach(x => Console.WriteLine(x.Nome));

            cerveja.AddFCerveja(new Cerveja()
            {
                Nome = "Tônico Guaraná"
            });

            cerveja.GetCervejas()
            .ToList <Cerveja>()
            .ForEach(x => Console.WriteLine(x.Nome));

            Console.ReadKey();
        }
Ejemplo n.º 27
0
        static void Main(string[] args)
        {
            /*cerveja.Cervejas.Add(new Cerveja() { Nome = "Golimar" });
             *
             * cerveja.SaveChanges();*/

            /*erveja.Cervejas.ToList<Cerveja>()
             *  .ForEach(x => Console.WriteLine(x.Nome));*/

            cerveja.AddCerveja(new Cerveja()
            {
                Nome = "ratata cerveja Racionais"
            });

            cerveja.GetCervejas()
            .ToList <Cerveja>()
            .ForEach(x => Console.WriteLine(x.Nome));

            Console.ReadKey();
        }
Ejemplo n.º 28
0
        static void Main(string[] args)
        {
            /*cerveja.Cervejas.Add(new Cerveja() { Nome = "Skol Beats" });
             *
             * cerveja.SaveChanges();*/

            /*cerveja.Cervejas.ToList<Cerveja>()
             *   .ForEach(x => Console.WriteLine(x.Nome));*/

            cerveja.AddCerveja(new Cerveja()
            {
                Nome = "Cerveja Stella"
            });
            //só adiciona a lista o nome que tiver 'Cerveja no nome'

            cerveja.GetCervejas()
            .ToList <Cerveja>()
            .ForEach(x => Console.WriteLine(x.Nome));

            Console.ReadKey();
        }
Ejemplo n.º 29
0
        static void Main(string[] args)
        {
            /*context.Cervejas.Add(new Cerveja() { Nome = "Original 600ml c/12", Teor = 5.1, Tipo = "Pilsen" });
             * context.SaveChanges();*/

            //controller.Cervejas.ToList<Cerveja>().ForEach(x => Console.WriteLine($"Nome {x.Nome} Tipo {x.Tipo} Teor de Álcool {x.Teor}"));

            cerveja.AddCerveja(new Cerveja()
            {
                Nome = "Cerveja Skol", Teor = 4, Tipo = "Pilsen"
            });

            cerveja.GetCervejas().ToList <Cerveja>().ForEach(x => Console.WriteLine($"Nome {x.Nome}"));

            /*
             * string template = "ID: {0,-3} | Nome: {1,-30} | Idade: {2,5} ";
             * alunoController.GetAlunos().OrderBy(x => x.Nome).ToList<Alunos>()
             *  .ForEach(v => Console.WriteLine(String.Format(template, v.Id, v.Nome, v.Idade)));
             */

            Console.ReadLine();
        }
Ejemplo n.º 30
0
        private static void MostraMenuSistema()
        {
            var menuEscolhido = int.MinValue;

            while (menuEscolhido != 0)
            {
                Console.Clear();

                Console.WriteLine("Menu Sistema De Cervejas");
                Console.WriteLine("1 - Lista de Cervejas");
                Console.WriteLine("2 - Cadastro de Cervejas");
                Console.WriteLine("3 - Valor Total do Custo das Cervejas");
                Console.WriteLine("4 - Valor Total de Litros das Cervejas");
                Console.WriteLine("0 - Sair do Sistema");

                Console.WriteLine("Digite menu escolhido:");
                menuEscolhido = int.Parse(Console.ReadLine());

                switch (menuEscolhido)
                {
                case 1:
                    cervejaController.GetCervejas().ForEach(i => ImprimeInformacoes(i));
                    break;

                case 2:
                    AdicionaCerveja();
                    break;

                case 3:
                    ValorTotalCervejas();
                    break;

                case 4:
                    ValorTotalEmLitros();
                    break;
                }
                Console.ReadKey();
            }
        }