20090925
PRACTICA3.2 AREA DE UN TRIANGULO (visual).
ESTRUCTURA DEL PROGRAMA VISUAL,. PARA EL CALCULO DE AREA PARA TRIANGULO.
sing 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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
double P, Area, A, B, C;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
A = double.Parse(textBox1.Text);
B = double.Parse(textBox2.Text);
C = double.Parse(textBox3.Text);
P = (A + B + C) / 2;
Area = Math.Sqrt(P * (P - A) * (P - B) * (P - C));
textBox4.Text = (" ") + 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();
}
}
}
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario