codigo conversor de unidades de volumen en c#

Páginas: 5 (1031 palabras) Publicado: 7 de febrero de 2015
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;namespace WpfApplication5
{
///
/// Lógica de interacción para MainWindow.xaml
///
public partial class MainWindow : Window
{
double valor1;
double valor2;
double auxiliar;
int que, que2;

public MainWindow()
{
InitializeComponent();
}

private void cbOrigen_SelectionChanged(objectsender, SelectionChangedEventArgs e)
{

}

private void btConvertir_Click(object sender, RoutedEventArgs e)
{
que = cbOrigen.SelectedIndex;
que2 = cbDestino.SelectedIndex;

valor1 = System.Convert.ToDouble(txOrigen.Text);

if(que == 1 && que2 == 1)
{
valor2 = valor1;}
if (que == 1 && que2 == 2)
{
valor2 = valor1 / 100;
}
if (que == 1 && que2 == 3)
{
valor2 = valor1 / 1000;
}

if (que == 1 && que2 == 4)
{
valor2 = valor1;
}
if (que == 1 && que2 == 5)
{valor2 = valor1 / 1000000;
}
if (que == 1 && que2 == 6)
{
valor2 = valor1 * 0.061024;
}
if (que == 1 && que2 == 7)
{
valor2 = valor1 * 0.000035;
}
if (que == 1 && que2 == 8)
{
valor2 = valor1 * 0.000001;
}if (que == 1 && que2 == 9)
{
valor2 = valor1 * 0.000264;
}
if(que == 1 && que2 == 10)
{
valor2 = valor1 * 0.000006;
}
if (que == 1 && que2 == 11)
{
valor2 = valor1 * 0.033814;
}



if (que ==2 && que2 == 1)
{
valor2 = valor1 * 100;
}
if (que == 2&& que2 == 2)
{
valor2 = valor1;
}
if (que == 2&& que2 == 3)
{
valor2 = valor1 * 0.1;
}
if (que == 2&& que2 == 4)
{
valor2 = valor1 * 100;}
if (que == 2&& que2 == 5)
{
valor2 = valor1 * 0.0001;
}
if (que == 2&& que2 == 6)
{
valor2 = valor1 * 6.102374;
}
if (que ==2 && que2 ==7)
{
valor2 = valor1 * 0.003531;
}
if (que == 2&& que2 == 8)
{valor2 = valor1 * 0.000131;
}
if (que == 2&& que2 == 9)
{
valor2 = valor1 * 0.026417;
}
if (que == 2&& que2 == 10)
{
valor2 = valor1 * 0.000629;
}
if (que == 2&& que2 == 11)
{
valor2 = valor1 * 3.381402;}



if ( que == 3 && que2 == 1)
{
valor2 = valor1 * 1000;
}
if ( que == 3 && que2 == 2)
{
valor2 = valor1 *10;
}
if ( que == 3 && que2 == 3)
{
valor2 = valor1;
}
if ( que...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Manual Tecnico Conversor de Unidades C#
  • Conversor de unidades
  • Conversor De Unidades
  • Unidades de volumen
  • Conversor de unidades en java
  • Conversores, y calculadoras en dev c++
  • Conversor codigo Gray a binario
  • Unidades de medida del volumen

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS