Exemplo n.º 1
0
 //Overloaded Constructor
 public GreenPlan(/*int carNum, */ GreenType type, string make, string model, string city, string hwy, int msrp)
 {
     //CarNum = carNum;
     Type    = type;
     Make    = make;
     Model   = model;
     CityMpg = city;
     HwyMpg  = hwy;
     Msrp    = msrp;
 }
Exemplo n.º 2
0
        private void TypeCars(GreenType type)
        {
            Console.Clear();
            List <GreenPlan> typeCars = _greenPlanRepo.GetCars();
            int carCounts             = 1;

            foreach (GreenPlan car in typeCars)
            {
                car.CarNum = carCounts;
                _greenPlanRepo.GetCars();
                if (car.Type == type)
                {
                    Console.WriteLine($"{car.CarNum}   {car.Type},{car.Make}, {car.Model}, {car.CityMpg}/{car.HwyMpg}, Starting MSRP: {car.Msrp}");
                    carCounts++;
                }
            }
            //     Console.ReadKey();
        }
Exemplo n.º 3
0
 private void RandomizeGreenType()
 {
     GreenType = (GreenType) new Random().Next(0, 6);
 }