Example #1
0
 private void CotizacionMonedas(double dolar, double peso, double euro)
 {
     Euro.SetCotizacion(euro);
     Dolar.SetCotizacion(dolar);
     Pesos.SetCotizacion(peso);
 }
Example #2
0
        public static Euro operator +(Euro e, Dolar d)
        {
            Euro euro = new Euro(e.cantidad + ((Euro)d).cantidad);

            return(euro);
        }
        static void Main(string[] args)
        {
            Console.Title = "Ejercicio 20";

            Euro  e = new Euro(2);
            Dolar d = new Dolar(2);
            Pesos p = new Pesos(2);

            Console.WriteLine("Cotizacion pesos: {0}\nCotizacion euro: {1}", Pesos.GetCotizacion(), Euro.GetCotizacion());

            Console.WriteLine("Cantidad de dolares: {0}\nCantidad de pesos: {1}\nCantidad de euros: {2}", d.GetCantidad(), p.GetCantidad(), e.GetCantidad());

            Console.WriteLine("Total pesificado: {0}", ((p + d) + e).GetCantidad());
            Console.WriteLine("Total dolarizado: {0}", ((d + p) + e).GetCantidad());
            Console.WriteLine("Total en euros: {0}", ((e + d) + p).GetCantidad());



            Console.ReadKey();
        }
Example #4
0
        public static Euro operator -(Euro e, Pesos p)
        {
            Euro euro = new Euro(e.cantidad - ((Euro)p).cantidad);

            return(euro);
        }
Example #5
0
 public static float operator +(Dolar d, Euro e)
 {
     return((d + e) * Euro.GetCotizacion());
 }