static void Main(string[] args) { Curency curency = new Curency(); Product obj1 = new Product(); Console.WriteLine("Введіть кількість записів :"); int n = Convert.ToInt32(Console.ReadLine()); Product[] products = new Product[n]; Product[] mas = new Product[n]; mas = ReadProductsArray(products); PrintProducts(mas); Console.WriteLine($"\n\nЗагальна ціна всіх продуктів {obj1.GetTotalPriceUAN(mas)}\n"); Console.WriteLine($"\n\nЗагальна вага всіх продуктів - {obj1.GetTotalWeight(mas)}\n"); Product max, min; GetProductInfo(mas, out max, out min); Console.WriteLine($"\n\nНайдорожчий товар - {max.getName()}. Його ціна - {max.getPrice()}"); Console.WriteLine($"\n\nНайдевший товар - {min.getName()}. Його ціна - {min.getPrice()}"); Console.WriteLine("\n\n\nМасив відсортований по ціні:"); SortProductsByPrice(mas); PrintProducts(mas); SortProductsByCount(mas); Console.WriteLine("\n\n\nМасив відсортований по кількості товару на складі:"); PrintProducts(mas); }
public Product(Product other) { Name = other.Name; _price = other._price; _cost = other._cost; _producer = other._producer; _quantity = other._quantity; _weight = other._weight; }
public Product(Product other) { Name = other.Name; Price = other.Price; Cost = other.Cost; Producer = other.Producer; Quantity = other.Quantity; Weight = other.Weight; }
public void setCost(Curency val) { _cost = val; }