title: Selecting a random object from a list of objects
body: <p>I'm trying to randomly select one of the customer items from the list. I am not sure what to do to actually print out the info within the list.</p>
  
  <p>I have this as my customer class</p>
  
  <pre><code>namespace PizzaParlor
  {
      class Customer
      {
          private string name;
          private int flavor;
          private int price;
          private int quality;
          private int speed;
          private int accessibility;
          private int brand;
          private int convenience;
          private int variety;
  
          public Customer(string name, int flavor, int price, int quality, int speed, int accessibility, int brand, int convenience, int variety)
          {
              this.name = name;
              this.flavor = flavor;
              this.price = price;
              this.quality = quality;
              this.speed = speed;
              this.accessibility = accessibility;
              this.brand = brand;
              this.convenience = convenience;
              this.variety = variety;
          }
  
          // Name, Speed, Quality, Variety, Convenience, Accessibility, price, brand, flavor
          public string Name
          {
              get { return name; }
              set { name = value; }
          }
  
          public int Speed
          {
              get { return speed; }
              set { speed = value; }
          }
  
          public int Quality
          {
              get { return quality; }
              set { quality = value; }
          }
  
          public int Variety
          {
              get { return variety; }
              set { variety = value; }
          }
  
          public int Convenience
          {
              get { return convenience; }
              set { convenience = value; }
          }
  
          public int Accessibility
          {
              get { return accessibility; }
              set { accessibility = value; }
          }
  
          public int Price
          {
              get { return price; }
              set { price = value; }
          }
  
          public int Brand
          {
              get { return brand; }
              set { brand = value; }
          }
  
          public int Flavor
          {
              get { return flavor; }
              set { flavor = value; }
          }
      }
  }
  </code></pre>
  
  <p>and this as my main class that I set up to work with the customer class:</p>
  
  <pre><code>namespace PizzaParlor 
  {
      class Program
      {
          static void Main(string[] args)
          {
              var random = new Random();
  
              List&lt;Customer&gt; CustomerList = new List&lt;Customer&gt;();
  
              CustomerList.Add(new Customer("bill", 20,15,10,5,10,20,5,15));
              CustomerList.Add(new Customer("kevin", 15, 10, 5, 20, 15, 15, 0, 20));
              CustomerList.Add(new Customer("clair", 8,25,2,25,5,15,0,20));
              CustomerList.Add(new Customer("jim", 15,20,10,15,0,40,0,0));
              CustomerList.Add(new Customer("rachel", 20,15,10,5,10,30,0,10));
              CustomerList.Add(new Customer("jeff", 30,20,5,5,10,10,0,20));
              CustomerList.Add(new Customer("Mike", 21,23,0,10,14,16,0,16));
              CustomerList.Add(new Customer("john", 25,15,10,10,10,5,5,20));
  
              int index = random.Next(CustomerList.Count);
  
              Console.WriteLine(CustomerList[index]);
          }
      }
  }
  </code></pre>
  
  <p>I know that the <code>random.Next(CustomerList.Count)</code> will randomly a select from the list but I don't know why it is returning this output:</p>
  
  <p><img src="https://i.stack.imgur.com/YJlFG.jpg" alt="output picture"></p>