sábado, 1 de noviembre de 2008

Practica 4 Problema 3

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)
{
double pies, yardas, pulgadas, cm, metros, cmplg, mpie;
pies = double.Parse(textBox1.Text);
mpie = pies;
yardas = mpie / 3.0;
pulgadas = mpie * 12.0;
cmplg = pulgadas;
cm = cmplg * 2.54;
metros = cm / 100;
textBox2.Text = yardas.ToString();
textBox3.Text = pulgadas.ToString();
textBox4.Text = cm.ToString();
textBox5.Text = metros.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox5.Clear();
textBox1.Focus();
}
}
}

No hay comentarios: