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 practica_3_3_area_y_volumen_de_un_cilindro__Windows
{
public partial class Form1 : Form
{
double radio, altura, volumen, area;
public Form1()
{
radio = altura = volumen = area;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
radio = double.Parse(textBox1.Text);
altura = double.Parse(textBox2.Text);
volumen = (3.1416 * radio * radio * altura);
area = 2*(3.1416*radio*radio*3.1416*radio*altura);
textBox3.Text = ("El volumen del cilindro es: "+volumen.ToString());
textBox4.Text=("El area del cilindro es: "+ area.ToString());
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
No hay comentarios:
Publicar un comentario