示例#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;
 }
示例#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();
        }
示例#3
0
 private void RandomizeGreenType()
 {
     GreenType = (GreenType) new Random().Next(0, 6);
 }