Example #1
0
        static void Main(string[] args)
        {
            VehicleFactory vFactory = new VehicleFactory();
            Car            c        = vFactory.GetVehicle("Corolla");

            Console.WriteLine(c.GetCarInfo());
        }
Example #2
0
        static void Main(string[] args)
        {
            var v1 = VehicleFactory.GetVehicle(2);

            v1.Drive();

            var v2 = VehicleFactory.GetVehicle(4);

            v2.Drive();
        }
Example #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter number of wheels for vehicle:");
            var wheelCount = Convert.ToInt32(Console.ReadLine());

            var newVehicle = VehicleFactory.GetVehicle(wheelCount);

            newVehicle.Drive();
            Console.WriteLine($"This vehicle has {newVehicle.NumOfWheels} wheels.");
        }
Example #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("How many wheels will your vehicle have?");
            var numberOfWheels = Console.ReadLine();

            IVehicle vehicle1 = VehicleFactory.GetVehicle(numberOfWheels);

            Console.WriteLine();

            vehicle1.Drive();
        }
Example #5
0
        static void Main(string[] args)
        {
            Console.WriteLine("How many tires are on a vehicle");
            int tires = int.Parse(Console.ReadLine());

            //VehicleFactory factory = new VehicleFactory();
            IVehicle vehicle = VehicleFactory.GetVehicle(tires);



            vehicle.Drive();
        }
Example #6
0
        static void Main(string[] args)
        {
            int  numberOfWheels;
            bool input = false;

            do
            {
                Console.WriteLine("Enter the amount of tires for the vehicle you want to create.");

                input = int.TryParse(Console.ReadLine(), out numberOfWheels);
            } while (input == false);

            var vehicle = VehicleFactory.GetVehicle(numberOfWheels);

            vehicle.Drive();
        }
        static void Main(string[] args)
        {
            var      vehicleType = ValidateInput.ValidationVehicleChoice("What type of Vehicle do want to make?").ToLower();
            IVehicle mustang     = VehicleFactory.GetVehicle(vehicleType);

            mustang.Drive();

            vehicleType = ValidateInput.ValidationVehicleChoice("What type of Vehicle do want to make?");
            IVehicle goldWing = VehicleFactory.GetVehicle(vehicleType);

            goldWing.Drive();

            vehicleType = ValidateInput.ValidationVehicleChoice("What type of Vehicle do want to make?");
            IVehicle peterbilt = VehicleFactory.GetVehicle(vehicleType);

            peterbilt.Drive();
        }