Exemple #1
0
        public static Celsius operator -(Celsius c, Farenheit f)
        {
            Celsius cel = new Celsius(0);

            cel            = (Celsius)f;
            cel._cantidad -= c.getCantidad();
            return(c);
        }
Exemple #2
0
        public static Celsius operator -(Celsius c, Kelvin k)
        {
            Celsius cel = new Celsius(0);

            cel            = (Celsius)k;
            cel._cantidad -= c.getCantidad();
            return(cel);
        }
Exemple #3
0
        public static bool operator ==(Kelvin k, Celsius c)
        {
            Celsius cel = new Celsius(0);

            cel = (Celsius)k;
            float aux = (float)cel.getCantidad();

            return(aux == (float)c.getCantidad());
        }
Exemple #4
0
        public static bool operator ==(Celsius c, Farenheit f)
        {
            Celsius cel = new Celsius(0);

            cel = (Celsius)f;
            if (c.getCantidad() == (float)cel.getCantidad())
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #5
0
        private void button3_Click(object sender, EventArgs e)
        {
            Farenheit far = new Farenheit(0);
            Kelvin    aux = new Kelvin(0);
            Celsius   cel = new Celsius(0);
            Kelvin    kel = new Kelvin(double.Parse(textBox3.Text));

            aux            = kel;
            far            = (Farenheit)kel;
            cel            = (Celsius)kel;
            textBox4.Text  = (far.getCantidad().ToString());
            textBox7.Text  = (cel.getCantidad().ToString());
            textBox10.Text = (aux.getCantidad().ToString());
        }
Exemple #6
0
        private void button2_Click(object sender, EventArgs e)
        {
            Farenheit far = new Farenheit(0);
            Celsius   aux = new Celsius(0);
            Celsius   cel = new Celsius(double.Parse(textBox2.Text));
            Kelvin    kel = new Kelvin(0);

            aux            = cel;
            far            = (Farenheit)cel;
            kel            = (Kelvin)far;
            textBox5.Text  = (far.getCantidad().ToString());
            textBox8.Text  = (aux.getCantidad().ToString());
            textBox11.Text = (kel.getCantidad().ToString());
        }
Exemple #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            Farenheit far = new Farenheit(double.Parse(textBox1.Text));
            Farenheit aux = new Farenheit(0);
            Celsius   cel = new Celsius(0);
            Kelvin    kel = new Kelvin(0);

            aux            = far;
            cel            = (Celsius)far;
            kel            = (Kelvin)far;
            textBox6.Text  = (aux.getCantidad().ToString());
            textBox9.Text  = (cel.getCantidad().ToString());
            textBox12.Text = (kel.getCantidad().ToString());
        }