Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            CarLot.AddCar(new Car("Ford", "Wrangler", 2021, 31000.99m));
            CarLot.AddCar(new Car("Ford", "Escape", 2017, 31999.90m));
            CarLot.AddCar(new Car("Chevy", "Sonic", 2017, 44989.95m));
            CarLot.AddCar(new UsedCar("Dodge", "Ram", 2016, 18000m, 33000));
            CarLot.AddCar(new UsedCar("Honda", "Civic ", 2015, 12795.50m, 35987));
            CarLot.AddCar(new UsedCar("Toyota", "Camry", 2009, 8400.48m, 180000));
            Console.WriteLine("Welcome to Grant Chirpus' Used Car Emporium!\n");
            bool cont = true;

            while (cont)
            {
                cont = CarLot.ListCars();
            }
        }
Ejemplo n.º 2
0
        static public void UserAddedCar()
        {
            Console.Write("Make: ");
            string make = Console.ReadLine();

            Console.Write("Model: ");
            string model = Console.ReadLine();

            Console.Write("Year: ");
            int year = Int32.Parse(Console.ReadLine());

            Console.Write("Price: ");
            decimal price = Int32.Parse(Console.ReadLine());

            Console.Write("Mileage: ");
            double mileage = Int32.Parse(Console.ReadLine());

            CarLot.AddCar(new UsedCar(make, model, year, price, mileage));
        }