public override string ToString() { StringBuilder vehicleStringData = new StringBuilder(); vehicleStringData.Append(base.ToString() + "\n"); vehicleStringData.Append(m_WheelData.ToString() + "\n"); vehicleStringData.Append("Number Of Doors: " + m_NumberOfDoors + "\n"); vehicleStringData.Append("Car Color: " + m_CarColor); return(string.Format(vehicleStringData.ToString())); }
public override string ToString() { StringBuilder vehicleStringData = new StringBuilder(); vehicleStringData.Append(base.ToString() + "\n"); vehicleStringData.Append(m_WheelData.ToString() + "\n"); vehicleStringData.Append("License Type: " + m_TypeOfLicense + "\n"); vehicleStringData.Append("Engine Size: " + m_EngineSize); return(string.Format(vehicleStringData.ToString())); }
public override string ToString() { StringBuilder vehicleStringData = new StringBuilder(); vehicleStringData.Append(base.ToString() + "\n"); vehicleStringData.Append(m_WheelData.ToString() + "\n"); vehicleStringData.Append(m_FuelData.ToString() + "\n"); vehicleStringData.Append("Trunk Volume: " + m_TrunkVolume + "\n"); vehicleStringData.Append("Driving hazardous materials? : " + m_IsDrivingHazardousMaterial); return(string.Format(vehicleStringData.ToString())); }
public override string ToString() { return(string.Format( @" Car ---------------------------- Model: {0} License number: {1} {2} Number of wheels: {3} {4} Color: {5} Number of Doors: {6}", ModelName, LicenseNumber, Engine.ToString(), k_NumOfWheels, Wheel.ToString(), m_CarColor, m_NumOfDoorsInCar)); }
// Overriding object's ToString() method. public override string ToString() { return(string.Format( @" Truck ----- Model: {0} License number: {1} {2} Number of wheels: {3} {4} Maximum carrying weight: {5} Has dangerous material: {6} ", ModelName, LicenseNumber, Wheel.ToString(), k_NumOfWheels, Engine.ToString(), m_MaxLoadingWeight, m_CarryigHazardousMaterial)); }
// Overrding Object's method. public override string ToString() { return(string.Format( @" Motorcycle ---------- Model: {0} License number: {1} {2} Number of wheels: {3} {4} License Type: {5} Engine Volume: {6} ", ModelName, LicenseNumber, Wheel.ToString(), k_NumOfWheels, Engine.ToString(), m_LicenseType, m_EngineVolume)); }