public static void Main(string[] args)
        {
            var car  = new Car("Skoda", "Fabia", 65, "CC1856BG");
            var car2 = new Car("Audi", "A3", 110, "EB8787MN");

            Console.WriteLine(car.ToString());


            var parking = new Parking(5);

            Console.WriteLine(parking.AddCar(car));


            Console.WriteLine(parking.AddCar(car));


            Console.WriteLine(parking.AddCar(car2));


            Console.WriteLine(parking.GetCar("EB8787MN").ToString());


            Console.WriteLine(parking.RemoveCar("EB8787MN"));


            Console.WriteLine(parking.Count);
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            var car  = new Car("Skoda", "Fabia", 65, "CC1856BG");
            var car2 = new Car("Audi", "A3", 110, "EB8787MN");

            Console.WriteLine(car.ToString());
            //Make: Skoda
            //Model: Fabia
            //HorsePower: 65
            //RegistrationNumber: CC1856BG

            var parking = new Parking(5);

            Console.WriteLine(parking.AddCar(car));
            //Successfully added new car Skoda CC1856BG

            Console.WriteLine(parking.AddCar(car));
            //Car with that registration number, already exists!

            Console.WriteLine(parking.AddCar(car2));
            //Successfully added new car Audi EB8787MN

            Console.WriteLine($"GetingCar" + parking.GetCar("EB8787MN").ToString());
            //Make: Audi
            //Model: A3
            //HorsePower: 110
            //RegistrationNumber: EB8787MN

            Console.WriteLine(parking.RemoveCar("EB8787MN"));
            //Successfullyremoved EB8787MN

            Console.WriteLine(parking.Count); //1
        }
Esempio n. 3
0
        public static void Main(string[] args)
        {
            var car  = new Car("Skoda", "Fabia", 65, "CC1856BG");
            var car2 = new Car("Audi", "A3", 110, "EB8787MN");
            var car3 = new Car("Audi", "A3", 110, "EB8787MN");
            var car4 = new Car("Audi", "A3", 110, "EB8787MS");

            var list = new List <string>();

            list.Add(car.RegistrationNumber);
            list.Add(car2.RegistrationNumber);


            var parking = new Parking(2);

            Console.WriteLine(parking.AddCar(car));
            Console.WriteLine(parking.AddCar(car2));

            Console.WriteLine(parking.GetCar("EB8787MN"));

            Console.WriteLine(parking.RemoveCar("EB8787M"));

            parking.RemoveSetOfRegistrationNumber(list);

            Console.WriteLine(parking.Count);
        }
Esempio n. 4
0
        public static void Main(string[] args)
        {
            Car car1 = new Car("Skoda", "Fabia", 120, "CB1260AB");
            Car car2 = new Car("Opel", "Vectra", 140, "CA1281AC");
            Car car3 = new Car("BMW", "S4", 230, "CB4444AC");
            Car car4 = new Car("Porshe", "911", 300, "OO1281AC");
            Car car5 = new Car("Audi", "A8", 225, "AA5566YY");
            Car car6 = new Car("Mercedes", "S800", 140, "CM6623MC");

            Parking parking = new Parking(10);

            parking.AddCar(car1);
            parking.AddCar(car1);
            parking.AddCar(car2);
            System.Console.WriteLine(parking.GetCar("CB1260AB"));
            //System.Console.WriteLine(parking.Count);
            //System.Console.WriteLine(car1.ToString());
            //parking.RemoveCar("CA1281AC");
            //System.Console.WriteLine(parking.Count);
            //parking.RemoveCar("CA1281AC");
            parking.AddCar(car3);
            parking.AddCar(car4);
            parking.AddCar(car5);
            parking.AddCar(car6);
            System.Console.WriteLine(parking.Count);
            List <string> regNumbers = new List <string>();

            regNumbers.Add("CM6623MC");
            regNumbers.Add("AA5566YY");

            parking.RemoveSetOfRegistrationNumber(regNumbers);
            System.Console.WriteLine(parking.Count);
            System.Console.WriteLine(parking.AddCar(car6));
        }
Esempio n. 5
0
        public static void Main(string[] args)
        {
            var car     = new Car("Skoda", "Fabia", 65, "CC1856BG");
            var parking = new Parking(2);

            Console.WriteLine(parking.AddCar(car));
            Console.WriteLine(parking.GetCar("hjk"));
            Console.WriteLine(parking.Count);
        }
        public static void Main()
        {
            Parking parking = new Parking(2);

            Car car = new Car("Skoda", "Fabia", 65, "CC1856BG");

            Console.WriteLine(parking.AddCar(car));

            Console.WriteLine(parking.GetCar(car.RegistrationNumber));
        }
Esempio n. 7
0
        public static void Main()
        {
            var car  = new Car("Skoda", "Fabia", 65, "CC1856BG");
            var car2 = new Car("Audi", "A3", 110, "EB8787MN");
            var car3 = new Car("Audi", "A3", 110, "BB8787MN");

            var parking = new Parking(2);

            Console.WriteLine(parking.AddCar(car));
            Console.WriteLine(parking.AddCar(car2));
            Console.WriteLine(parking.RemoveCar("CC1856B"));
            Console.WriteLine(parking.GetCar("CC1856BG"));
            Console.WriteLine(parking.Count);
        }
        public static void Main(string[] args)
        {
            Car car  = new Car("Skoda", "Fabia", 65, "CC1856BG");
            Car car2 = new Car("Audi", "A3", 110, "EB8787MN");
            Car car3 = new Car("Dacia", "Fabia", 65, "CC1956BG");
            Car car4 = new Car("Opel", "Astra", 110, "EB9987MN");
            Car car5 = new Car("BMW", "Astra", 110, "EB8887MN");
            Car car6 = new Car("Mazda", "Astra", 110, "EB4487MN");

            Parking parking = new Parking(5);

            Console.WriteLine(parking.AddCar(car));
            Console.WriteLine(parking.AddCar(car2));
            Console.WriteLine(parking.AddCar(car3));
            Console.WriteLine(parking.AddCar(car4));
            Console.WriteLine(parking.AddCar(car5));
            Console.WriteLine(parking.AddCar(car6));

            Console.WriteLine(parking.GetCar("CC1856BG").ToString());
            Console.WriteLine(parking.GetCar("EB8787MN").ToString());
            Console.WriteLine(parking.GetCar("CC1956BG").ToString());
            Console.WriteLine(parking.GetCar("EB9987MN").ToString());
        }
        static void Main(string[] args)
        {
            //Car audiCar = new Car("Audi", "A4", 120, "AB7865ES");
            //Parking parking = new Parking(4);
            //parking.Cars.Add(audiCar);
            //Console.WriteLine(parking.Cars.Count);
            //Console.WriteLine(parking.Cars.Capacity);
            //Car bmwCar = new Car("Bmw", "M3", 299, "AB7865ES");
            //parking.Cars.Add(bmwCar);
            //Console.WriteLine(parking.Cars.Capacity);

            var car  = new Car("Skoda", "Fabia", 65, "CC1856BG");
            var car2 = new Car("Audi", "A3", 110, "EB8787MN");

            Console.WriteLine(car.ToString());
            //Make: Skoda
            //Model: Fabia
            //HorsePower: 65
            //RegistrationNumber: CC1856BG

            var parking = new Parking(5);

            Console.WriteLine(parking.AddCar(car));
            //Successfully added new car Skoda CC1856BG

            Console.WriteLine(parking.AddCar(car));
            //Car with that registration number, already exists!

            Console.WriteLine(parking.AddCar(car2));
            //Successfully added new car Audi EB8787MN

            Console.WriteLine(parking.GetCar("EB8787MN").ToString());
            //Make: Audi
            //Model: A3
            //HorsePower: 110
            //RegistrationNumber: EB8787MN

            //Console.WriteLine(parking.RemoveCar("EB8787MN"));
            //Successfullyremoved EB8787MN

            Console.WriteLine(parking.Count); //1

            List <string> regNumbers = new List <string>();

            regNumbers.Add("EB8787MN");
            regNumbers.Add("EB8787MN");

            parking.RemoveSetOfRegistrationNumber(regNumbers);
        }
Esempio n. 10
0
        public static void Main()
        {
            try
            {
                var car  = CreateCar("Skoda", "Fabia", 65, "CC1856BG");
                var car2 = CreateCar("Audi", "A3", 110, "EB8787MN");

                Console.WriteLine(car.ToString());
                //Make: Skoda
                //Model: Fabia
                //HorsePower: 65
                //RegistrationNumber: CC1856BG

                Parking parking = CreateParking(5);
                Console.WriteLine(parking.AddCar(car));
                //Successfully added new car Skoda CC1856BG

                Console.WriteLine(parking.AddCar(car));
                //Car with that registration number, already exists!

                Console.WriteLine(parking.AddCar(car2));
                //Successfully added new car Audi EB8787MN

                Console.WriteLine(parking.GetCar("EB8787MN").ToString());
                //Make: Audi
                //Model: A3
                //HorsePower: 110
                //RegistrationNumber: EB8787MN

                Console.WriteLine(parking.RemoveCar("EB8787MN"));
                //Successfullyremoved EB8787MN

                Console.WriteLine(parking.Count); //1
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public static void Main(string[] args)
        {
            var car  = new Car("Skoda", "Fabia", 65, "CC1856BG");
            var car2 = new Car("Audi", "A3", 110, "EB8787MN");

            Console.WriteLine(car.ToString());

            var parking = new Parking(5);

            Console.WriteLine(parking.AddCar(car));
            Console.WriteLine(parking.AddCar(car));
            Console.WriteLine(parking.AddCar(car2));

            Console.WriteLine(parking.GetCar("EB8787MN").ToString());

            Console.WriteLine(parking.RemoveCar("EB8787MN"));

            //List<string> numbers = new List<string> {"CC1856BG","EB8787MN"};
            //parking.RemoveSetOfRegistrationNumber(numbers);

            Console.WriteLine(parking.Count);
        }