private static string MakeName(Make make2) { string makeName = ""; if (make2 == Make.other) { Console.WriteLine("Please enter make of your car: "); Console.WriteLine("\n\t Enter 'e' to exit"); makeName = Console.ReadLine(); if (makeName == "e") { makeName = null; EnterToContinue(); Console.Clear(); return(makeName); } else if (makeName.Length <= 10) { EnterToContinue(); Console.Clear(); return(makeName); } else { Console.WriteLine("Color name must be shorter than 10 letters. Please, try again..."); } } else { EnterToContinue(); Console.Clear(); return(make2.ToString()); } EnterToContinue(); Console.Clear(); return(makeName); }
public override string GetCarInfo() { return(Make.ToString() + " | " + Year + " | " + Color.ToString() + " | " + Convert.ToString(FormatMoney(Price)) + " | " + HorsePower.ToString()); }
public override string ToString() //prints used car details { return(Year.ToString() + " " + Make.ToString() + " " + Model.ToString() + " (Used) with " + Mileage.ToString() + " miles for $" + Price.ToString() + " Car ID: " + Id.ToString()); }
public virtual string ToString() //prints new car details { return(Year.ToString() + " " + Model.ToString() + " " + Make.ToString() + " for $" + Price.ToString() + " Car ID: " + Id.ToString()); }
public override string ToString() { return(Make.ToString() + " " + Name); }
public override string ToString() { return(Make.ToString() + "\n" + Model.ToString() + "\n" + CurrentSpeed.ToString() + "\n" + EngineSize.ToString()); }