namespace USchleifeFor
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void CmdAnzeigen1_Click(object sender, EventArgs e)
        {
            LblAnzeige.Text = "";
            for (double d = 35; d >= 20; d -= 2.5)
                LblAnzeige.Text += $"{d} ";
        }

        private void CmdAnzeigen2_Click(object sender, EventArgs e)
        {
            int count = 0;
            double summe = 0.0, mw;

            LblAnzeige.Text = "";
            for (double d = 35; d >= 20; d -= 2.5)
            {
                LblAnzeige.Text += $"{d} ";
                count++;
                summe += d;
            }

            mw = summe / count;
            LblAnzeige.Text += $"\nSumme: {summe}";
            LblAnzeige.Text += $"\nMittelwert: {mw}";
        }
    }
}
