private void btn_dolar_Click(object sender, EventArgs e) { Dolares dol = new Dolares(double.Parse(txtDolar.Text)); txtDolarDolar.Text = string.Format("{0}", dol.GetCantidad()); txtDolarEuro.Text = string.Format("{0}", ((Euros)dol).GetCotizacion()); txtDolarPesos.Text = string.Format("{0}", ((Pesos)dol).GetCotizacion()); }
static void Main(string[] args) { Euros e = new Euros(10); Pesos p = new Pesos(10); Dolares d = new Dolares(10); e = e + p; Console.WriteLine(e.GetCantidad()); Console.ReadKey(); }
static void Main(string[] args) { Console.Title = "Ejercicio 20"; Pesos peso = new Pesos(); Dolares dolar = new Dolares(); Euros euro = new Euros(); Console.ReadKey(); }
private void button2_Click(object sender, EventArgs e) { double d; if (double.TryParse(textBox2.Text, out d)) { Dolares p = new Dolares(d); textBox12.Text = string.Format("{0,10:#,###.00}", p.GetCantidad()); textBox5.Text = string.Format("{0,10:#,###.00}", ((Pesos)p).GetCantidad()); textBox9.Text = string.Format("{0,10:#,###.00}", ((Euros)p).GetCantidad()); } }
private void button1_Click(object sender, EventArgs e) { string Nombre = NombreText.Text; string Apellido = ApellidoText.Text; string Cedula = CedulaText.Text; Cedula = Convert.ToString(Cedula); string Dirección = DireccionText.Text; string Lugar = LugarText.Text; string Codigo = CodigoText.Text; string Tarjeta = TarjetaDe.Text; string Codi = CodigoDe.Text; int Cantidad, Dolares; Cantidad = int.Parse(CantidadEn.Text); Dolares = Cantidad / 45; if (Dol.Checked) { Dolar.Text = Dolares.ToString(); Peso.Text = "0"; } if (Pes.Checked) { Peso.Text = Cantidad.ToString(); Dolar.Text = "0"; } if (Efectivo.Checked) { TarjetaDe.Text = "Innecesario"; CodigoDe.Text = "Innecesario"; } if (Tarjetas.Checked) { TarjetaDe.Text = ""; CodigoDe.Text = ""; } string lines = "Nombre: " + Nombre + "\r\n" + "Apellido: " + Apellido + "\r\n" + "Cedula: " + Cedula + "\r\n" + "Dirección: " + Dirección + "\r\n" + "Lugar: " + Lugar + "\r\n" + "Servicio: " + "\r\n" + "Cantidad en Dolares: " + Dolares + "\r\n" + "Cantidad en Pesos: " + Cantidad + "\r\n" + "Tarjeta " + Tarjeta + "\r\n" + "Codigo de Tarjeta " + Codi + "\r\n"; string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\Formulario.txt"; System.IO.StreamWriter file = new System.IO.StreamWriter(path, true); file.WriteLine(lines); file.Close(); if (System.IO.File.Exists(path)) { MessageBox.Show("Los Datos han sido guardados exitasamente"); } NombreText.Text = ""; ApellidoText.Text = ""; CedulaText.Text = ""; DireccionText.Text = ""; LugarText.Text = ""; CodigoText.Text = ""; TarjetaDe.Text = ""; CodigoDe.Text = ""; }