sábado, 1 de noviembre de 2008

Practica 5 Problema 4

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double Largo, Ancho, Area, Precio, PrecioT;
Largo = double.Parse(textBox1.Text);
Ancho = double.Parse(textBox2.Text);
Precio = double.Parse(textBox3.Text);
Area = Largo * Ancho;
if (Area <= 400.00) PrecioT = Area * Precio;
else PrecioT = Area * (Precio - Precio * 0.10); textBox4.Text = PrecioT.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox1.Focus();
}
}
}

No hay comentarios: