jueves, 24 de septiembre de 2009

PRACTICA 3.1 CILINDRO

CONSOLA







VISUAL








using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ejercicio_3_visual
{
public partial class Form1 : Form
{
float radio, altura;
double volumen, area;
public Form1()
{
radio = altura = 0;
volumen = area = 0;


InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
altura = float.Parse(txtb1.Text);
radio = float.Parse(txtb2.Text);
volumen = 3.1416 * radio * radio * altura;
area = 2 * (3.1416 * radio * radio + 3.1416 * radio * altura);
txtb3.Text = volumen.ToString();
txtb4.Text = area.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
txtb1.Clear();
txtb2.Clear();
txtb3.Clear();
txtb4.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
}
private void txtb1_TextChanged(object sender, EventArgs e)
{

}

}
}

No hay comentarios:

Publicar un comentario