public static void Main()
Vehicle vehicle = new Vehicle("Chevy", "Silverado", 2000);
Console.WriteLine(vehicle.DisplayInfo());
Car car = new Car("Jeep", "Wrangler", 2014, 4, true);
Console.WriteLine(car.DisplayInfo());
public Vehicle(string make, string model, int year)
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string DisplayInfo()
return ($"You have a {Year} {Make} {Model}");
internal class Car : Vehicle
public Car(string make, string model, int year, int numDoors, bool isConvert) : base(make, model, year)
NumberOfDoors = numDoors;
IsConvertible = isConvert;
public int NumberOfDoors { get; set; }
public bool IsConvertible { get; set; }
new public string DisplayInfo()
if (IsConvertible == true)
return ($"You have a {Year} {Make} {Model} with {NumberOfDoors} doors that {yes} a convertible");