using System.Collections.Generic;
public string Make{get;set;}
public string Model{get;set;}
public string SerialNum{get;set;}
public Vehicle (string vmake, string vmodel, int vprice,string snum)
public virtual string DisplayInfo()
public bool VerifySerialNum ()
if(SerialNum.StartsWith("A1"))
public int SeatCapacity{get;set;}
public Car(string vmake, string vmodel, int vprice, string snum, int capacity):base (vmake,vmodel,vprice,snum)
public override string DisplayInfo()
else if (SeatCapacity>=4 & SeatCapacity<=6)
public class Truck:Vehicle
public int LoacCapacity{get;set;}
public Truck(string vmake, string vmodel, int vprice, string snum, int load):base (vmake,vmodel,vprice,snum)
public override string DisplayInfo()
else if (LoacCapacity>=5000 & LoacCapacity<=10000)
public static List<Vehicle> VehicleList = new List<Vehicle>();
public static void Main (string[] args)
VehicleNew = new Car("Tesla","Model Y",56690,"A1234",7);
VehicleList.Add(VehicleNew);
VehicleNew = new Truck("Ford", "F-250", 34950, "B4322", 8000);
VehicleList.Add(VehicleNew);
foreach (Vehicle V in VehicleList)
Console.WriteLine(V.Make);