public static Kelvin operator -(Kelvin k, Farenheit f) { Kelvin kel = new Kelvin(0); kel = (Kelvin)f; kel._cantidad -= k._cantidad; return(kel); }
public static Kelvin operator -(Kelvin k, Celsius c) { Kelvin kel = new Kelvin(0); kel = (Kelvin)c; kel._cantidad -= k._cantidad; return(kel); }
public static bool operator ==(Celsius c, Kelvin k) { Kelvin kel = new Kelvin(0); kel = (Kelvin)c; float aux = (float)kel.getCantidad(); return(aux == (float)k.getCantidad()); }
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()); }
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()); }
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()); }
private void btnConvertKelvin_Click(object sender, EventArgs e) { double grados; if (double.TryParse(txtKelvin.Text, out grados)) { Kelvin k = new Kelvin(grados); txtKelvinToKelvin.Text = k.GetGrados().ToString(); txtKelvinToFahrenheit.Text = ((Fahrenheit)k).GetGrados().ToString(); txtKelvinToCelsius.Text = ((Celcius)k).GetGrados().ToString(); } else { txtKelvin.Focus(); } }