private static void UserInputForAutomobiles() { Console.WriteLine("What is your dream car?"); var UserInput = Console.ReadLine(); var isCarType = Enum.TryParse(UserInput, out CarType carType); if (isCarType) { IAutomobile automobile; switch (carType) { case CarType.Suv: automobile = new SUV(); automobile.Mileage = 170; automobile.Type = carType; automobile.VroomVroom(); break; case CarType.Rickshaw: automobile = new Rickshaw { Mileage = 5, Type = carType }; automobile.VroomVroom(); break; case CarType.Sports: automobile = new Sports(); automobile.Mileage = 75; automobile.Type = carType; automobile.VroomVroom(); break; } } }