Esempio n. 1
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);
        }
        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. 3
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);

            var parking = new Parking(5);

            parking.AddCar(car);
            parking.AddCar(car2);
            // parking.RemoveCar("EB8787MN");

            parking.GetCar("EB8787MN");
        }
Esempio n. 4
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("Audi1234", "A3", 110, "EB878*MN");

            var parking = new Parking(3);

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

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

            Console.WriteLine(parking.cars[2]);
        }
Esempio n. 5
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(parking.GetCar("EB8787MN").ToString());
            //Make: Audi
            //Model: A3
            //HorsePower: 110
            //RegistrationNumber: EB8787MN

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

            currentReg.Add("EB8787MN");

            currentReg.Add("dasdewe");



            parking.RemoveSetOfRegistrationNumber(currentReg);


            Console.WriteLine(parking.Count);
        }
Esempio n. 6
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);
        }
        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());
        }