Ejemplo n.º 1
0
        private void btn_calc_kfa_Click(object sender, EventArgs e)
        {
            try
            {
                double stomach = Convert.ToDouble(tB_stomach.Text);
                double neck    = Convert.ToDouble(tB_neck.Text);
                double height  = Convert.ToDouble(tB_height.Text);
                double waist   = Convert.ToDouble(tB_waist.Text);

                if (rB_male.Checked)
                {
                    double kfa = Cl_Athlete.calc_kfa(stomach, neck, height);
                    MessageBox.Show("Digga, dein KFA liegt bei " + kfa + " %!");
                }
                else if (rB_female.Checked)
                {
                    double kfa = Cl_Athlete.calc_kfa(stomach, neck, height, waist);
                    MessageBox.Show("Diggi, dein KFA liegt bei " + kfa + " %!");
                }
            }

            catch
            {
                MessageBox.Show("Es sind nicht alle Felder ausgefüllt!");
            }
        }
Ejemplo n.º 2
0
        private void button1_Click_2(object sender, EventArgs e)
        {
            Cl_Athlete Daniel = new Cl_Athlete("DanielS", "*****@*****.**", "male", 78, 175, mC_birthdate.SelectionRange.Start);

            Cl_ActivityCalculator activity = new Cl_ActivityCalculator();

            activity.Goal_kcal = Cl_ActivityCalculator.calc_goal_calories(0.5);

            activity.Job_factor = Cl_ActivityCalculator.get_job_factor("normal");

            activity.Sport_kcal = Cl_ActivityCalculator.get_sport_calories(Daniel, 60, 3, "power lifting");

            Daniel.Kfa = Cl_Athlete.calc_kfa(100, 78, Daniel.Height);

            Daniel.Bizeps_left = 34;

            Daniel.Bizeps_right = 33.5;

            Daniel.Butt = 98;

            Daniel.Calf_left = 39;

            Daniel.Calf_right = 38;

            Daniel.Chest = 98;

            Daniel.Ffm = Cl_Athlete.calc_ffm(Daniel.Weight, Daniel.Kfa);

            Daniel.Ffmi = Cl_Athlete.calc_ffmi(Daniel.Height, Daniel.Ffm);

            Daniel.Kcal = Convert.ToInt32(Cl_Athlete.calc_kcal(activity, Daniel));

            Daniel.Lat = 100;

            Daniel.Quad_left = 88;

            Daniel.Quad_right = 87.5;

            Daniel.Shoulders = 105;

            Daniel.Stomach = 100;

            Daniel.Waist = 90;

            Daniel.Neck = 77;

            MessageBox.Show("Meine Daten sind wie folgt: \n" + Daniel.Kfa + "\n" + Daniel.Ffm + "\n" + Daniel.Ffmi + "\n" + Daniel.Kcal);
        }