Prime b

Prime b

  • NA
  • 810
  • 346k

Classes and fields

Feb 3 2012 5:43 PM
Create a class named Car with auto-implemented properties
for the vehicle ID number, make, model, color, and value of a
Car object. Write a DisplayFleet( ) method that accepts any
number of Car objects, displays their values, and displays the
total value of all Car objects passed to the method. Write a
Main( ) method that declares fi ve Car objects and assigns values
to each, then calls DisplayFleet() three times—passing
three, four, and fi ve Car objects in successive calls..


This is as far as I could get... I am not sure what they mean by "accept any number of Car objects" , do I like have to create list, array or what?
What should I do next?


        private int vIdNumber;
        private string vMake;
        private int vModel;
        private string vColor;
        private double vValue;

        public int VidNumber { get; set; }
        public string Vmake { get; set; }
        public int Vmodel { get; set; }
        public string Vcolor { get; set; }
        public double VValue { get; set; }


        public void DisplayFleet(double value)
        {

        }

Answers (5)