static void Main(string[] args) { // create new Heater object Heater heater = new Heater(); heater.IsOn = true; heater.Temperature = 100; heater.Humidity = 95; heater.PrintData(); Console.WriteLine(heater.ToString()); Console.ReadLine(); }
static void Main(string[] args) { // Create heater object Heater kiuas = new Heater(); kiuas.IsOn = true; kiuas.Temperature = 30; kiuas.Humidity = 40; kiuas.PrintData(); // Console.WriteLine("Temperature = " + kiuas.Temperature); Console.WriteLine(kiuas.ToString()); // ToString method }
static void Main(string[] args) { Heater heater = new Heater(); heater.Temperature = 100; heater.PrintData(); Heater heater2 = new Heater(); heater2.IsOn = true; heater2.IncreaseTemperature(); heater2.PrintData(); Console.WriteLine("temperature = " + heater2.Temperature); Console.WriteLine(heater2.ToString()); }
static void Main(string[] args) { Heater heater = new Heater(); heater.PrintData(); heater.Temperature = 80; heater.Humidity = 70; heater.RaiseTemperature(); heater.Off(); heater.PrintData(); heater.ToString(); Console.WriteLine(heater); Heater heater2 = new Heater(90, 85); heater2.PrintData(); heater2.LowerHumidity(); heater2.RaiseTemperature(); heater2.PrintData(); Console.WriteLine("Temperature = " + heater2.Temperature); }