miércoles, 21 de septiembre de 2016

CONVERSOR DE TEMPERATURAS


PRÁCTICA #7

CONVERSOR DE TEMPERATURAS

Objetivo: Crear un conversor de temperaturas


DISEÑO DEL PROGRAMA


Código del programa

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 Práctica_7
{
    public partial class frmConvertidor : Form
    {
        public frmConvertidor()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
   
            
        }

        private void btnSalir_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void btnLimpiar_Click(object sender, EventArgs e)
        {
            txtFarenheit.Clear();
            txtCentigrados.Clear();
        }

        private void btnConvertir_Click(object sender, EventArgs e)
        {
            double f, c;
            if (txtFarenheit.Text == "") ;
            {
                c = Convert.ToDouble(txtCentigrados.Text);
                f = c * 1.8 + 32;
                txtFarenheit.Text=Convert.ToString(f);
            }
        }
    }
}

No hay comentarios:

Publicar un comentario