Ejemplo n.º 1
0
        private void numData_ValueChanged(object sender, EventArgs e)
        {
            switch (cmbFigura.SelectedIndex)
            {
            case 0:
                txtPerimeter.Text = Perimeter.GetSquarePerimeter((double)numData1.Value).ToString();
                txtArea.Text      = Area.GetSquareArea((double)numData1.Value).ToString();
                break;

            case 1:
                txtArea.Text = Area.GetTriangleArea((double)numData1.Value, (double)numData2.Value).ToString();
                break;

            case 2:
                txtPerimeter.Text = Perimeter.GetCirclePerimeter((double)numData1.Value).ToString();
                txtArea.Text      = Area.GetCircleArea((double)numData1.Value).ToString();
                break;

            case 3:
                txtArea.Text      = Area.GetParallelogramArea((double)numData1.Value, (double)numData2.Value).ToString();
                txtPerimeter.Text = Perimeter.GetParalelogramPerimeter((double)numData1.Value, (double)numData2.Value).ToString();
                break;

            case 4:
                txtArea.Text = Area.GetRhombusArea((double)numData1.Value, (double)numData2.Value).ToString();
                break;

            case 5:
                txtArea.Text = Area.GetParallelogramArea((double)numData1.Value, (double)numData2.Value).ToString();
                break;

            case 6:
                txtArea.Text = Area.GetTrapezoidArea((double)numData1.Value, (double)numData2.Value, (double)numData3.Value).ToString();
                break;

            case 7:
                txtPerimeter.Text = Perimeter.GetRegularPolygonPerimeter((int)numData1.Value, (double)numData2.Value).ToString();
                txtArea.Text      = Area.GetRegularPolygonArea((int)numData1.Value, (double)numData2.Value, (double)numData3.Value).ToString();
                break;

            case 8:
                txtArea.Text    = Area.GetCubeArea((double)numData1.Value).ToString();
                txtVolumen.Text = Volume.GetCubeVolume((double)numData1.Value).ToString();
                break;

            case 9:
                txtVolumen.Text = Volume.GetSphereVolume((double)numData1.Value).ToString();
                break;

            case 10:
                txtVolumen.Text = Volume.GetPrismVolume((int)numData1.Value, (double)numData2.Value, (double)numData3.Value, (double)numData4.Value).ToString();
                break;

            case 11:
                txtVolumen.Text = Volume.GetCylinderVolume((double)numData1.Value, (double)numData2.Value).ToString();
                break;

            case 12:
                txtVolumen.Text = Volume.GetPyramidVolume((int)numData1.Value, (double)numData2.Value, (double)numData3.Value, (double)numData4.Value).ToString();
                break;

            case 13:
                txtVolumen.Text = Volume.GetConeVolume((double)numData1.Value, (double)numData2.Value).ToString();
                break;

            default:
                break;
            }
        }