static void Main(string[] args) { Vehicle yourVehicle = VehicleFactory.GetVehicle(); yourVehicle.BuildVehicle(); yourVehicle.DownPayment(); }
static void Main(string[] args) { Console.WriteLine("How many tires does your vehicle have?"); int NumberOfTires = Convert.ToInt32(Console.ReadLine()); var myVehicle = VehicleFactory.GetVehicle(NumberOfTires); myVehicle.Drive(); }
static void Main(string[] args) { int tires; Console.WriteLine("Please enter the number of tires you desire: "); tires = int.Parse(Console.ReadLine()); IVehicle vehicle = VehicleFactory.GetVehicle(tires); if (vehicle != null) { vehicle.Drive(); } }
static void Main(string[] args) { int wheelCount; bool input = false; do { Console.WriteLine("Enter the amount of tires for the vehicle you want to create:"); input = int.TryParse(Console.ReadLine(), out wheelCount); } while (input == false); var vehicle = VehicleFactory.GetVehicle(wheelCount); vehicle.Drive(); }
static void Main(string[] args) { int numberOfWheels; bool input = false; do { Console.WriteLine("Enter the amount of wheels for the vehicle you would like to create"); input = int.TryParse(Console.ReadLine(), out numberOfWheels); } while (input == false); var vehicle = VehicleFactory.GetVehicle(numberOfWheels); vehicle.Drive(); }