static void Main(string[] args) { Tovar[] tvr = new Tovar[7]; tvr = List(); Console.WriteLine("\n\tSort list:"); Sort(tvr); Console.WriteLine("\n\tTotal amount of goods:"); Sum(tvr); Console.WriteLine("\n\tProtracted goods:"); Overdue(tvr); Console.WriteLine("\n\tIdentical products:"); CheckTovar(tvr); Console.ReadKey(); }
static Tovar[] List() { Tovar[] tv = new Tovar[7]; DateTime tvrDate1; tv[0] = new Tovar("Beef 1 kg", 10.57, tvrDate1 = new DateTime(2019, 7, 10), 3); tv[1] = new Tovar("Watermelon 1 kg", 8.49, tvrDate1 = new DateTime(2019, 7, 10), 30); tv[2] = new Tovar("Mozzarella 200 gr", 29.99, tvrDate1 = new DateTime(2019, 3, 5), 180); tv[3] = new Tovar("Milk 1 l", 19.5, tvrDate1 = new DateTime(2019, 7, 1), 12); tv[4] = new Tovar("Sugar 1 kg", 16.29, tvrDate1 = new DateTime(2019, 3, 24), 365); tv[5] = new Tovar("Milk 1 l", 19.5, tvrDate1 = new DateTime(2019, 7, 1), 12); tv[6] = new Tovar("Ice Cream Monaco 80 gr", 23.99, tvrDate1 = new DateTime(2019, 3, 1), 90); return(tv); }