using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
ti t = new ti(double.Parse(textBox1.Text), double.Parse(textBox2.Text), double.Parse(textBox3.Text));
textBox4.Text = t.tArea().ToString();
}
public class ti
{
public double a;
public double b;
public double h;
public double area;
public ti(double ta, double tb, double th)
{
a = ta;
b = tb;
h = th;
}
public double tArea()
{
area = (a + b) * h / 2;
return area;
}
}
}
}I