Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public override string GetCarInfo()
 {
     return(Make.ToString() + " | " + Year + " | " + Color.ToString() + " | " + Convert.ToString(FormatMoney(Price)) + " | " + HorsePower.ToString());
 }
Esempio n. 3
0
 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());
 }
Esempio n. 4
0
 public virtual string ToString() //prints new car details
 {
     return(Year.ToString() + " " + Model.ToString() + " " + Make.ToString() + " for $" + Price.ToString() + " Car ID: " + Id.ToString());
 }
Esempio n. 5
0
 public override string ToString()
 {
     return(Make.ToString() + " " + Name);
 }
Esempio n. 6
0
 public override string ToString()
 {
     return(Make.ToString() + "\n" + Model.ToString() + "\n" + CurrentSpeed.ToString() + "\n" + EngineSize.ToString());
 }