Exemple #1
0
        public void IsDomestic()
        {
            string[] domestic = new string[] { "GM", "Ford", "Lincoln", "Chrysler",
                                               "Caddilac", "Jeep", "Tesla" };

            foreach (string domCar in domestic)
            {
                if (Make.Contains(domCar))
                {
                    Console.WriteLine("Domestic");
                }
            }

            string[] foreign = new string[] { "Nissan", "Mitsubishi", "Infiniti", "Honda", "Toyota",
                                              "Mercedes Benz", "Audi", "BMW", "Volkswagen" };

            foreach (string forCar in foreign)
            {
                if (Make.Contains(forCar))
                {
                    Console.WriteLine("Foreign");
                }
            }
        }