Dia Mejor

Practica 2.2 Windows

Author: Moises






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 Practica2_Problema2_windows
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btCalcular_Click(object sender, EventArgs e)
{
textBox1.Focus();
double costom2, largo, ancho, costof, area, costofinal;
largo = double.Parse(textBox1.Text);
ancho = double.Parse(textBox2.Text);
costom2 = double.Parse(textBox3.Text);
costof = (largo * ancho * costom2);
area = largo * ancho;
if (area >= 500 && area < costofinal =" (costof" text =" costofinal.ToString();" text =" costofinal.ToString(">= 1000)
{
costofinal = (costof - ((costof / 100) * 25));
textBox5.Text = costofinal.ToString();
textBox6.Text = costofinal.ToString("Tiene 25%");
}
else
{
textBox5.Text = costof.ToString();
textBox6.Text = costof.ToString("No tiene descuento");
}
}
}
private void btLimpiar_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox5.Clear();
textBox6.Clear();
textBox1.Focus();
}
private void btSalir_Click(object sender, EventArgs e)
{
Close();
}
}
}

 

0 Response to “Practica 2.2 Windows”

Leave a Reply