All pastes #795300 Raw Edit

Unnamed

public text v1 · immutable
#795300 ·published 2007-11-23 23:54 UTC
rendered paste body
private void button1_Click(object sender, EventArgs e)
        {
            string str;
            double c, p, a, tl, d, sum, max, min;
            c = p = a = tl = d = sum = max = min = 0;

            c = Convert.ToDouble(cbox.Text);
            p = Convert.ToDouble(pbox.Text);
            a = Convert.ToDouble(abox.Text);
            tl = Convert.ToDouble(tlbox.Text);
            d = Convert.ToDouble(dbox.Text);
            sum = (c + p + a + tl + d) / 5;
            max = c;
            if(p > max)
                max = p;
            if(a > max)
                max = a;
            if(tl > max)    
                max = tl;
            if(d > max)
                max = d;

            min = c;
            if(p < min)
                min = p;
            if(a < min)
                min = a;
            if(tl < min)
                min = tl;
            if(d < min)
                min = d;
            str = "Max: " + max.ToString() + "\nMin: " + min.ToString() + "\nSum: " + sum.ToString();
            MessageBox.Show(str);
        }