Example #1
0
        static void Main(string[] args)
        {
            var c1 = new ConversorInstancia();
            var c2 = new ConversorInstancia();

            ConversorInstancia.temperatura = 30;
            var celsius = c1.CelsiusToFah();

            ConversorInstancia.temperatura = 70;
            var fah = c1.FahToCelsius();

            Console.WriteLine("Celsius = " + celsius);
            Console.WriteLine("Fah = " + fah);
            Console.ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            var temperatura = 35.0;

            temperatura = ConversorStatic.CelsiusToFah(temperatura);


            //Instancia
            ConversorInstancia conversorInstancia = new ConversorInstancia();
            var celsius = conversorInstancia.CelsiusToFah();
            var fah     = conversorInstancia.FahToCelsius();

            Console.WriteLine(temperatura);
            Console.WriteLine(celsius);
            Console.WriteLine(fah);
            Console.ReadKey();
        }