Beispiel #1
0
        static void Main(string[] args)
        {
            Lunch lunch1, lunch2, lunch3, lunch4, lunch5;

            //Constructors
            lunch1 = new Lunch();
            lunch2 = new Lunch();
            lunch3 = new Lunch();
            lunch4 = new Lunch();
            lunch5 = new Lunch();

            lunch1.Entree = "Hamburger";
            lunch1.Side   = "Fries";
            lunch1.Drink  = "Cola";

            lunch2.Entree = "Hot Dog";
            lunch2.Side   = "Chips";
            lunch2.Drink  = "Lemonade";

            lunch3.Entree = "Pizza";
            lunch3.Side   = "Salad";
            lunch3.Drink  = "Iced Tea";

            lunch4.Entree = "Tuna Sandwich";
            lunch4.Side   = "Fruit Cup";
            lunch4.Drink  = "Water";

            lunch5.Entree = "Peanut Butter Sandwich";
            lunch5.Side   = "Cookie";
            lunch5.Drink  = "Milk";

            Display(lunch1, lunch2, lunch3);
            Console.WriteLine();
            Display(lunch1, lunch2, lunch3, lunch4);
            Console.WriteLine();
            Display(lunch1, lunch2, lunch3, lunch4, lunch5);
            Console.WriteLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Lunch lunch1, lunch2, lunch3, lunch4, lunch5;

            lunch1 = new Lunch();
            lunch2 = new Lunch();
            lunch3 = new Lunch();
            lunch4 = new Lunch();
            lunch5 = new Lunch();

            lunch1.Entree = "hot dog";
            lunch1.Drink  = "lemon aid";
            lunch1.Food   = "chips";

            lunch2.Entree = "pizza";
            lunch2.Drink  = "salad";
            lunch2.Food   = "coke";

            lunch3.Entree = "chicken sandwich";
            lunch3.Drink  = "water";
            lunch3.Food   = "shepards pie";

            lunch4.Entree = "ceral";
            lunch4.Drink  = "orange juice";
            lunch4.Food   = "toast";

            lunch5.Entree = "apple pie";
            lunch5.Drink  = "fanta";
            lunch5.Food   = "snack box";

            Display(lunch1, lunch2, lunch3);
            Console.WriteLine();
            Display(lunch1, lunch2, lunch3, lunch4);
            Console.WriteLine();
            Display(lunch1, lunch2, lunch3, lunch4, lunch5);
        }