static void Main(string[] args)
        {
            var appCollection = new appliances[0];
            var flag          = true;

            while (flag)
            {
                try
                {
                    Console.WriteLine("\n-----------OPTIONS-------------");
                    Console.WriteLine("Enter 1 - to Add Appliance and Hours Connected");
                    Console.WriteLine("Enter 2 - to View Collection");
                    Console.WriteLine("Enter 3 - to View Common Intervals");
                    Console.WriteLine("Enter x - to EXIT");

                    Console.Write(">>> ");
                    var input = Console.ReadLine();
                    switch (input)
                    {
                    case "1":
                        appCollection = addAppliances(appCollection, add());
                        Console.WriteLine("\tAdded");
                        break;

                    case "2":
                        view(appCollection);
                        break;

                    case "3":
                        printCommonInterval(appCollection);
                        break;

                    case "x": flag = false; break;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"\t***{ex.Message.ToString()}***");
                }
            }
            Console.Read();
        }
 static appliances[] addAppliances(appliances[] collection, appliances item)
 {
     Array.Resize(ref collection, collection.Length + 1);
     collection[collection.Length - 1] = item;
     return(collection);
 }