static void Main(string[] args) { /*Tinta pluma1 = new Tinta(); * Tinta pluma2 = new Tinta(); * * Console.WriteLine(Tinta.Mostrar(pluma1)); * Console.WriteLine(pluma1 == pluma2); * * Tinta pluma3 = new Tinta(ConsoleColor.Red); * Console.WriteLine(pluma1 == pluma3); * Console.WriteLine(pluma1 != pluma3);*/ Tinta pluma0 = new Tinta(ConsoleColor.DarkCyan); Pluma lapicera = new Pluma("firuleti", 50, pluma0); Console.Write(lapicera); if (lapicera == pluma0) { Console.Write("\nSon iguales!\n"); } else { Console.Write("\n\tNo son iguales!\n"); } Console.ReadLine(); Tinta pluma3 = new Tinta(ConsoleColor.DarkMagenta); Pluma lapicera3 = new Pluma("grido", 70, pluma3); Console.Write(lapicera3); if (lapicera3 != pluma3) { Console.Write("\nSon iguales!\n"); } else { Console.Write("\nNo son iguales!\n"); } Console.ReadLine(); Tinta pluma1 = new Tinta(ConsoleColor.DarkGreen); Pluma lapicera_1 = new Pluma("kalawa", 25, pluma1); Console.Write(lapicera_1); lapicera_1 = lapicera_1 + pluma1; Console.Write("\n\tSUMA\n"); Console.Write(lapicera_1); Console.ReadLine(); Tinta pluma2 = new Tinta(ConsoleColor.DarkYellow); Pluma lapicera_2 = new Pluma("ggg", 46, pluma2); Console.Write(lapicera_2); lapicera_2 = lapicera_2 - pluma2; Console.Write("\n\tRESTA\n"); Console.Write(lapicera_2); Console.ReadLine(); }
static void Main(string[] args) { Tinta obj1 = new Tinta(); Tinta obj2 = new Tinta(ConsoleColor.Red); Console.WriteLine(Tinta.Mostrar(obj1)); if (obj1 == obj2) { Console.WriteLine("Son iguales"); } else { Console.WriteLine("Son distintos"); } Pluma obj3 = new Pluma(10, "asd", obj2); Pluma obj4 = new Pluma(10, "ggfg", obj1); Pluma obj5 = new Pluma(); Console.WriteLine(obj3); Console.WriteLine(obj4); obj3 += obj2; obj4 -= obj1; // obj3 -= obj1; Console.WriteLine(obj3); Console.WriteLine(obj4); Console.WriteLine(obj5); Console.ReadLine(); }
static void Main(string[] args) { Console.Title = "EjercicioClase05"; Tinta tin = new Tinta(ConsoleColor.Cyan, ETipoTinta.China); Console.WriteLine(Tinta.Mostrar(tin)); Tinta tint = new Tinta(); Console.WriteLine(Tinta.Mostrar(tint)); Pluma plum = new Pluma("marca", 2, tin); Console.WriteLine(plum); /* plum = plum + tint; * Console.WriteLine(plum);*/ /* Pluma pluam = new Pluma(); * Console.WriteLine(pluam);*/ Console.ReadLine(); }