static void Main(string[] args) { Fan fan1 = new Fan(); fan1.Speed = Fan.FAST; fan1.Radius = 10; fan1.Color = "yellow"; fan1.On = true; Console.WriteLine(fan1.ToString()); Fan fan2 = new Fan(); fan2.Speed = Fan.MEDIUM; Console.WriteLine(fan2.ToString()); }
static void Main(string[] args) { Fan fan1 = new Fan(); fan1.Speed = Fan.FAST; fan1.Color = "yellow"; fan1.On = true; Fan fan2 = new Fan(); fan2.Speed = Fan.MEDIUM; Console.WriteLine("Fan 1:"); fan1.DisplayFan(fan1); Console.WriteLine("\nFan 2:"); fan2.DisplayFan(fan2); }
static void Main(string[] args) { Fan fan1 = new Fan(); fan1.setColor("yellow"); fan1.setRadius(10); fan1.setSpeed(1); fan1.turnOn(); Fan fan2 = new Fan(); fan2.setColor("blue"); fan2.setRadius(5); fan2.setSpeed(2); fan2.turnOff(); Console.WriteLine(fan1.ToString()); Console.WriteLine(fan2.ToString()); }
static void Main(string[] args) { Console.WriteLine("Fan 1: Gia tri speed lon nhat, radius 10, color yellow va fan ON"); Fan fan_1 = new Fan(); fan_1.setSpeed(3); fan_1.setRadius(10); fan_1.setColor("Yellow"); Console.WriteLine(fan_1.ToString()); Console.WriteLine("\n\n"); Console.WriteLine("Fan 2: Gia tri speed trung binh, radius 5, color blue va fan OFF"); Fan fan_2 = new Fan(); fan_2.setSpeed(2); fan_2.seton(false); Console.WriteLine(fan_2.ToString()); Console.ReadKey(); }