Example #1
0
        static void AddLunch(Lunch[] lunchArray)
        {
            string entree = Console.ReadLine();
            string side   = Console.ReadLine();
            string drink  = Console.ReadLine();

            lunchArray[0] = new Lunch(entree, side, drink);
        }
Example #2
0
        static void Main(string[] args)
        {
            Lunch[] lunchArray = new Lunch[10];
            bool    newLunch   = true;

            do
            {
                Console.Write("Do you want to add a new lunch?(y/n): ");
                if (Console.ReadLine() == "y")
                {
                    AddLunch(lunchArray);
                }
                else
                {
                    newLunch = false;
                }
            }while (newLunch == true);
        }