Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int   comida_val      = 0;
            int   atendimento_val = 0;
            float gorJeta         = 0;

            foreach (RadioButton r in comida)
            {
                if (r.Checked)
                {
                    comida_val = Int32.Parse(r.Text);
                }
            }

            foreach (RadioButton r in atendimento)
            {
                if (r.Checked)
                {
                    atendimento_val = Int32.Parse(r.Text);
                }
            }

            restaurante.NotaAtendimento(atendimento_val);
            restaurante.NotaComida(comida_val);

            gorJeta = restaurante.GetGorjeta();

            label2.Text = gorJeta.ToString();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            RestauranteFuzzyLogic restaurante = new RestauranteFuzzyLogic();

            restaurante.NotaAtendimento(7);
            restaurante.NotaComida(7);


            System.Console.WriteLine(restaurante.GetGorjeta());

            System.Console.ReadLine();
        }