static void Main(string[] args) { Refrigerator[] refrigerators = new Refrigerator[5] { new Refrigerator("Whirlpool 340 L Frost Free 3 Star Refrigerator", "Black", 2000, 2, 20), new Refrigerator("Haier 320 L Frost Free 3 Star Refrigerator", "White", 1500, 2.15), new Refrigerator("Samsung 253 L Frost Free 4 Star Refrigerator", "Gray", 1679), new Refrigerator(), new Refrigerator("Samsung 253 L Frost Free 4 Star Refrigerator", "Black") }; Console.WriteLine($"Total number of refrigerators: {Refrigerator.refrigiratorCount}"); for (int i = 0; i < refrigerators.Length; i++) { Console.WriteLine($"Refrigirator #{i + 1}"); refrigerators[i].Print(); Console.WriteLine(); } refrigerators[3].CopyRefrigerator(ref refrigerators[0]); refrigerators[3].Print(); Console.WriteLine(); Console.WriteLine(refrigerators[0].IsOptimalPrice(2000)); Console.WriteLine(refrigerators[0].IsOptimalPrice(1000)); }
public void CopyRefrigerator(ref Refrigerator r) { Model = r.Model; Color = r.Color; Price = r.Price; Height = r.Height; Volume = r.Volume; }