예제 #1
0
        public static bool operator ==(Farenheit f, Kelvin k)
        {
            Farenheit far = new Farenheit(0);

            far = (Farenheit)k;
            return(far.getCantidad() == (float)f.getCantidad());
        }
예제 #2
0
        public static bool operator ==(Farenheit f, Celsius c)
        {
            Farenheit far = new Farenheit(0);

            far = (Farenheit)c;
            return(far.getCantidad() == (float)f.getCantidad());
        }
예제 #3
0
        public static Farenheit operator -(Farenheit f, Kelvin k)
        {
            Farenheit far = new Farenheit(0);

            far            = (Farenheit)k;
            far._cantidad -= f._cantidad;
            return(far);
        }
예제 #4
0
        public static Farenheit operator -(Farenheit f, Celsius c)
        {
            Farenheit far = new Farenheit(0);

            far            = (Farenheit)c;
            far._cantidad -= f._cantidad;
            return(far);
        }
예제 #5
0
        public static bool operator ==(Kelvin k, Farenheit f)
        {
            Farenheit far = new Farenheit(0);

            far = (Farenheit)k;
            float aux = (float)far.getCantidad();

            return(aux == (float)f.getCantidad());
        }
예제 #6
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());
        }
예제 #7
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());
        }
예제 #8
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());
        }